Files
clang-p2996/llvm/test/CodeGen/SPIRV/function/identity-function.ll
Ilia Diachkov 153dee34f1 [SPIR-V](6/6) Add the module analysis pass and the simplest tests
This patch adds one SPIRV analysis pass and extends AsmPrinter. It is
essential for minimum SPIR-V output. Also it adds several simplest tests
to show that the target basically works.

Differential Revision: https://reviews.llvm.org/D116465

Authors: Aleksandr Bezzubikov, Lewis Crawford, Ilia Diachkov,
Michal Paszkowski, Andrey Tretyakov, Konrad Trifunovic

Co-authored-by: Aleksandr Bezzubikov <zuban32s@gmail.com>
Co-authored-by: Ilia Diachkov <iliya.diyachkov@intel.com>
Co-authored-by: Michal Paszkowski <michal.paszkowski@outlook.com>
Co-authored-by: Andrey Tretyakov <andrey1.tretyakov@intel.com>
Co-authored-by: Konrad Trifunovic <konrad.trifunovic@intel.com>
2022-04-20 01:10:25 +02:00

20 lines
525 B
LLVM

; RUN: llc -O0 %s -o - | FileCheck %s
target triple = "spirv32-unknown-unknown"
; CHECK-DAG: OpName [[VALUE:%.+]] "value"
; CHECK-DAG: OpName [[IDENTITY:%.+]] "identity"
; CHECK: [[INT:%.+]] = OpTypeInt 32
; CHECK: [[FN:%.+]] = OpTypeFunction [[INT]] [[INT]]
; CHECK: [[IDENTITY]] = OpFunction [[INT]] None [[FN]]
; CHECK-NEXT: [[VALUE]] = OpFunctionParameter [[INT]]
; CHECK-NEXT: {{%.+}} = OpLabel
; CHECK-NEXT: OpReturnValue [[VALUE]]
; CHECK-NEXT: OpFunctionEnd
define i32 @identity(i32 %value) {
ret i32 %value
}