30 lines · plain
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-42 3; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-INT-84; 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 ArbitraryPrecisionIntegersALTERA8; CHECK-SPIRV: Extension "SPV_ALTERA_arbitrary_precision_integers"9; CHECK-INT-4: %[[#Int4:]] = OpTypeInt 4 010; CHECK-INT-8: %[[#Int4:]] = OpTypeInt 8 011; CHECK: OpTypeFunction %[[#]] %[[#Int4]]12; CHECK: %[[#Int4PtrTy:]] = OpTypePointer Function %[[#Int4]]13; CHECK: %[[#Const:]] = OpConstant %[[#Int4]] 114 15; CHECK: %[[#Int4Ptr:]] = OpVariable %[[#Int4PtrTy]] Function16; CHECK: OpStore %[[#Int4Ptr]] %[[#Const]]17; CHECK: %[[#Load:]] = OpLoad %[[#Int4]] %[[#Int4Ptr]]18; CHECK: OpFunctionCall %[[#]] %[[#]] %[[#Load]]19 20define spir_kernel void @foo() {21entry:22 %0 = alloca i423 store i4 1, ptr %024 %1 = load i4, ptr %025 call spir_func void @boo(i4 %1)26 ret void27}28 29declare spir_func void @boo(i4)30