Debian Codegraph @

llvm/test/CodeGen/SPIRV/extensions/SPV_INTEL_int4/negative.ll

raw
1 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown --spirv-ext=+SPV_ALTERA_arbitrary_precision_integers %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-INT-4
2
3 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-INT-8
4 ; No error would be reported in comparison to Khronos llvm-spirv, because type adjustments to integer size are made
5 ; in case no appropriate extension is enabled. Here we expect that the type is adjusted to 8 bits.
6
7 ; CHECK-SPIRV: Capability ArbitraryPrecisionIntegersALTERA
8 ; CHECK-SPIRV: Extension "SPV_ALTERA_arbitrary_precision_integers"
9 ; CHECK-INT-4: %[[#Int4:]] = OpTypeInt 4 0
10 ; CHECK-INT-8: %[[#Int4:]] = OpTypeInt 8 0
11 ; CHECK: OpTypeFunction %[[#]] %[[#Int4]]
12 ; CHECK: %[[#Int4PtrTy:]] = OpTypePointer Function %[[#Int4]]
13 ; CHECK: %[[#Const:]] = OpConstant %[[#Int4]] 1
14
15 ; CHECK: %[[#Int4Ptr:]] = OpVariable %[[#Int4PtrTy]] Function
16 ; CHECK: OpStore %[[#Int4Ptr]] %[[#Const]]
17 ; CHECK: %[[#Load:]] = OpLoad %[[#Int4]] %[[#Int4Ptr]]
18 ; CHECK: OpFunctionCall %[[#]] %[[#]] %[[#Load]]
19
20 define spir_kernel void @foo() {
21 entry:
22 %0 = alloca i4
23 store i4 1, ptr %0
24 %1 = load i4, ptr %0
25 call spir_func void @boo(i4 %1)
26 ret void
27 }
28
29 declare spir_func void @boo(i4)