Skip to content

Commit 17e8603

Browse files
jcranmer-inteldbudanov-cmplr
authored andcommitted
Mass add -emit-opaque-pointers for tests that require some changes.
Original commit: KhronosGroup/SPIRV-LLVM-Translator@6e15642
1 parent 77eea71 commit 17e8603

File tree

81 files changed

+523
-510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+523
-510
lines changed

llvm-spirv/test/CXX/global-ctor.cl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: llvm-spirv %t.bc -o %t.spv
33
// RUN: spirv-val %t.spv
44
// RUN: llvm-spirv %t.spv -to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV
5-
// RUN: llvm-spirv -r %t.spv -o - | llvm-dis -o - | FileCheck %s --check-prefix=CHECK-LLVM
5+
// RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis -o - | FileCheck %s --check-prefix=CHECK-LLVM
66
// RUN: not llvm-spirv %t.bc --spirv-max-version=1.0 2>&1 | FileCheck %s --check-prefix=CHECK-SPV10
77

88
class Something {
@@ -22,7 +22,7 @@ void kernel work(global int *out) {
2222
// CHECK-SPIRV: EntryPoint 6 [[ctor:[0-9]+]] "_GLOBAL__sub_I_global_ctor.cl"
2323
// CHECK-SPIRV: ExecutionMode [[ctor]] 33
2424

25-
// CHECK-LLVM: llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @[[CTORNAME:_GLOBAL__sub_I[^ ]+]], i8* null }
25+
// CHECK-LLVM: llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @[[CTORNAME:_GLOBAL__sub_I[^ ]+]], ptr null }
2626
// CHECK-LLVM: define spir_kernel void @[[CTORNAME]]
2727

2828
// CHECK-SPV10: Feature requires SPIR-V 1.1 or greater: Initializer/Finalizer Execution Mode

llvm-spirv/test/DebugInfo/DebugDeclareUnused.cl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// RUN: %clang_cc1 %s -triple spir -disable-llvm-passes -debug-info-kind=standalone -emit-llvm-bc -o - -no-opaque-pointers | llvm-spirv -spirv-mem2reg -o %t.spv
55
// RUN: llvm-spirv %t.spv -to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV
6-
// RUN: llvm-spirv -r %t.spv -o - | llvm-dis -o - | FileCheck %s --check-prefix=CHECK-LLVM
6+
// RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis -o - | FileCheck %s --check-prefix=CHECK-LLVM
77

88

99
void foo() {
@@ -12,4 +12,4 @@ void foo() {
1212

1313
// CHECK-SPIRV: Undef [[#]] [[#Undef:]]
1414
// CHECK-SPIRV: ExtInst [[#]] [[#]] [[#]] DebugDeclare [[#]] [[#Undef]] [[#]]
15-
// CHECK-LLVM: call void @llvm.dbg.declare(metadata i32* undef, metadata ![[#]], metadata !DIExpression({{.*}}))
15+
// CHECK-LLVM: call void @llvm.dbg.declare(metadata ptr undef, metadata ![[#]], metadata !DIExpression({{.*}}))

llvm-spirv/test/DebugInfo/DebugInfoLLVMArg.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
; RUN: llvm-spirv %t.bc -o %t.spv --spirv-allow-extra-diexpressions
55
; RUN: llvm-spirv %t.spv -to-text -o %t.spt
66
; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
7-
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
7+
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.rev.bc
88
; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM
99

1010
; CHECK-SPIRV: Undef [[#]] [[#UNDEF:]]
@@ -24,9 +24,9 @@ declare void @llvm.dbg.value(metadata, metadata, metadata) nounwind readnone spe
2424
define void @DbgIntrinsics() sanitize_memtag {
2525
entry:
2626
%x = alloca i32, align 4
27-
; CHECK-LLVM: call void @llvm.dbg.value(metadata !DIArgList(i32* %x), metadata ![[#]], metadata !DIExpression(DW_OP_LLVM_arg, 0))
27+
; CHECK-LLVM: call void @llvm.dbg.value(metadata !DIArgList(ptr %x), metadata ![[#]], metadata !DIExpression(DW_OP_LLVM_arg, 0))
2828
call void @llvm.dbg.value(metadata !DIArgList(i32* %x), metadata !6, metadata !DIExpression(DW_OP_LLVM_arg, 0)), !dbg !10
29-
; CHECK-LLVM: call void @llvm.dbg.value(metadata i32* undef, metadata ![[#]], metadata !DIExpression())
29+
; CHECK-LLVM: call void @llvm.dbg.value(metadata ptr undef, metadata ![[#]], metadata !DIExpression())
3030
call void @llvm.dbg.value(metadata !DIArgList(i32* %x, i32* %x), metadata !6, metadata !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus)), !dbg !10
3131
store i32 42, i32* %x, align 4
3232
ret void

llvm-spirv/test/DebugInfo/SourceLanguageSPIRVToLLVM.spvasm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@
1010
; REQUIRES: spirv-as
1111

1212
; RUN: sed -e 's/SOURCE_LANGUAGE/OpenCL_CPP/' %s | spirv-as --target-env spv1.3 - -o %t.spv
13-
; RUN: llvm-spirv -r %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-CPP14
13+
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-CPP14
1414

1515
; COM: TODO: Enable this test when the version of SPIRV-Tools used by buildbot is updated to
1616
; COM: recognise CPP_for_OpenCL as a valid source language.
1717
; COM: sed -e 's/SOURCE_LANGUAGE/CPP_for_OpenCL/' %s | spirv-as --target-env spv1.3 - -o %t.spv
1818
; COM: llvm-spirv -r %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-CPP14
1919

2020
; RUN: sed -e 's/SOURCE_LANGUAGE/OpenCL_C/' %s | spirv-as --target-env spv1.3 - -o %t.spv
21-
; RUN: llvm-spirv -r %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-OPENCL
21+
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-OPENCL
2222

2323
; RUN: sed -e 's/SOURCE_LANGUAGE/GLSL/' %s | spirv-as --target-env spv1.3 - -o %t.spv
24-
; RUN: llvm-spirv -r %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-OPENCL
24+
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-OPENCL
2525

2626
; RUN: sed -e 's/SOURCE_LANGUAGE/HLSL/' %s | spirv-as --target-env spv1.3 - -o %t.spv
27-
; RUN: llvm-spirv -r %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-OPENCL
27+
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-OPENCL
2828

2929
; RUN: sed -e 's/SOURCE_LANGUAGE/ESSL/' %s | spirv-as --target-env spv1.3 - -o %t.spv
30-
; RUN: llvm-spirv -r %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-OPENCL
30+
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-OPENCL
3131

3232
; RUN: sed -e 's/SOURCE_LANGUAGE/Unknown/' %s | spirv-as --target-env spv1.3 - -o %t.spv
33-
; RUN: llvm-spirv -r %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-OPENCL
33+
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-OPENCL
3434

3535
; SPIR-V
3636
; Version: 1.1

llvm-spirv/test/OpConvertPtrToU_narrowing.spvasm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; REQUIRES: spirv-as
22
; RUN: spirv-as --target-env spv1.0 -o %t.spv %s
33
; RUN: spirv-val %t.spv
4-
; RUN: llvm-spirv -r -o - %t.spv | llvm-dis | FileCheck %s
4+
; RUN: llvm-spirv -r -emit-opaque-pointers -o - %t.spv | llvm-dis | FileCheck %s
55
OpCapability Addresses
66
OpCapability Kernel
77
OpCapability Int16
@@ -25,4 +25,4 @@
2525
OpReturn
2626
OpFunctionEnd
2727

28-
; CHECK: ptrtoint i32 addrspace(1)* %a to i16
28+
; CHECK: ptrtoint ptr addrspace(1) %a to i16

llvm-spirv/test/OpConvertPtrToU_widening.spvasm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; REQUIRES: spirv-as
22
; RUN: spirv-as --target-env spv1.0 -o %t.spv %s
33
; RUN: spirv-val %t.spv
4-
; RUN: llvm-spirv -r -o - %t.spv | llvm-dis | FileCheck %s
4+
; RUN: llvm-spirv -r -emit-opaque-pointers -o - %t.spv | llvm-dis | FileCheck %s
55
OpCapability Addresses
66
OpCapability Kernel
77
OpCapability Int64
@@ -25,4 +25,4 @@
2525
OpReturn
2626
OpFunctionEnd
2727

28-
; CHECK: ptrtoint i32 addrspace(1)* %a to i64
28+
; CHECK: ptrtoint ptr addrspace(1) %a to i64

llvm-spirv/test/OpConvertUToPtr_narrowing.spvasm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; REQUIRES: spirv-as
22
; RUN: spirv-as --target-env spv1.0 -o %t.spv %s
33
; RUN: spirv-val %t.spv
4-
; RUN: llvm-spirv -r -o - %t.spv | llvm-dis | FileCheck %s
4+
; RUN: llvm-spirv -r -emit-opaque-pointers -o - %t.spv | llvm-dis | FileCheck %s
55
OpCapability Addresses
66
OpCapability Kernel
77
OpCapability Int64
@@ -23,4 +23,4 @@
2323
OpReturn
2424
OpFunctionEnd
2525

26-
; CHECK: inttoptr i64 %a to i32 addrspace(1)*
26+
; CHECK: inttoptr i64 %a to ptr addrspace(1)

llvm-spirv/test/OpConvertUToPtr_widening.spvasm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; REQUIRES: spirv-as
22
; RUN: spirv-as --target-env spv1.0 -o %t.spv %s
33
; RUN: spirv-val %t.spv
4-
; RUN: llvm-spirv -r -o - %t.spv | llvm-dis | FileCheck %s
4+
; RUN: llvm-spirv -r -emit-opaque-pointers -o - %t.spv | llvm-dis | FileCheck %s
55
OpCapability Addresses
66
OpCapability Kernel
77
OpCapability Int16
@@ -23,4 +23,4 @@
2323
OpReturn
2424
OpFunctionEnd
2525

26-
; CHECK: inttoptr i16 %a to i32 addrspace(1)*
26+
; CHECK: inttoptr i16 %a to ptr addrspace(1)

llvm-spirv/test/SpecConstants/OpSpecConstant.spvasm

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,35 @@
1616
; CHECK-INFO: Spec const id = 111, size in bytes = 8
1717

1818
; Negative tests for the command line option.
19-
; RUN: not llvm-spirv -r %t.spv -spec-const "1234" 2>&1 | FileCheck %s --check-prefix=CHECK-FORMAT
19+
; RUN: not llvm-spirv -r -emit-opaque-pointers %t.spv -spec-const "1234" 2>&1 | FileCheck %s --check-prefix=CHECK-FORMAT
2020
; CHECK-FORMAT: Invalid format of -spec-const option: "1234". Expected format: -spec-const "<id1:type1:value1 id2:type2:value2 ...>"
2121

22-
; RUN: not llvm-spirv -r %t.spv -spec-const "q:i32:4" 2>&1 | FileCheck %s --check-prefix=CHECK-ID
22+
; RUN: not llvm-spirv -r -emit-opaque-pointers %t.spv -spec-const "q:i32:4" 2>&1 | FileCheck %s --check-prefix=CHECK-ID
2323
; CHECK-ID: Invalid id for '-spec-const' option! In "q:i32:4": "q" must be a 32-bit unsigned integer
2424

25-
; RUN: not llvm-spirv -r %t.spv -spec-const "10:i32:1024" 2>&1 | FileCheck %s --check-prefix=CHECK-INVALID-ID
25+
; RUN: not llvm-spirv -r -emit-opaque-pointers %t.spv -spec-const "10:i32:1024" 2>&1 | FileCheck %s --check-prefix=CHECK-INVALID-ID
2626
; CHECK-INVALID-ID: CL_INVALID_SPEC_ID. "10:i32:1024": There is no specialization constant with id = 10 in the SPIR-V module.
2727

28-
; RUN: not llvm-spirv -r %t.spv -spec-const "101:32:99" 2>&1 | FileCheck %s --check-prefix=CHECK-TYPE
28+
; RUN: not llvm-spirv -r -emit-opaque-pointers %t.spv -spec-const "101:32:99" 2>&1 | FileCheck %s --check-prefix=CHECK-TYPE
2929
; CHECK-TYPE: Invalid type for '-spec-const' option! In "101:32:99": "32" - is not allowed type. Allowed types are: i1, i8, i16, i32, i64, f16, f32, f64
3030

31-
; RUN: not llvm-spirv -r %t.spv -spec-const "101:i9:99" 2>&1 | FileCheck %s --check-prefix=CHECK-TYPE-INT
31+
; RUN: not llvm-spirv -r -emit-opaque-pointers %t.spv -spec-const "101:i9:99" 2>&1 | FileCheck %s --check-prefix=CHECK-TYPE-INT
3232
; CHECK-TYPE-INT: Invalid type for '-spec-const' option! In "101:i9:99": "i9" - is not allowed type. Allowed types are: i1, i8, i16, i32, i64, f16, f32, f64
3333

34-
; RUN: not llvm-spirv -r %t.spv -spec-const "101:f8:99" 2>&1 | FileCheck %s --check-prefix=CHECK-TYPE-FP
34+
; RUN: not llvm-spirv -r -emit-opaque-pointers %t.spv -spec-const "101:f8:99" 2>&1 | FileCheck %s --check-prefix=CHECK-TYPE-FP
3535
; CHECK-TYPE-FP: Invalid type for '-spec-const' option! In "101:f8:99": "f8" - is not allowed type. Allowed types are: i1, i8, i16, i32, i64, f16, f32, f64
3636

37-
; RUN: not llvm-spirv -r %t.spv -spec-const "101:i8:257" 2>&1 | FileCheck %s --check-prefix=CHECK-VALUE-INT
37+
; RUN: not llvm-spirv -r -emit-opaque-pointers %t.spv -spec-const "101:i8:257" 2>&1 | FileCheck %s --check-prefix=CHECK-VALUE-INT
3838
; CHECK-VALUE-INT: Invalid value for '-spec-const' option! In "101:i8:257": can't convert "257" to 8-bit integer number
3939

40-
; RUN: not llvm-spirv -r %t.spv -spec-const "101:f32:4.40282347E+38" 2>&1 | FileCheck %s --check-prefix=CHECK-VALUE-FP
40+
; RUN: not llvm-spirv -r -emit-opaque-pointers %t.spv -spec-const "101:f32:4.40282347E+38" 2>&1 | FileCheck %s --check-prefix=CHECK-VALUE-FP
4141
; CHECK-VALUE-FP: Invalid value for '-spec-const' option! In "101:f32:4.40282347E+38": can't convert "4.40282347E+38" to 32-bit floating point number
4242

43-
; RUN: not llvm-spirv -r %t.spv -spec-const "101:i32:1024" 2>&1 | FileCheck %s --check-prefix=CHECK-VALUE
43+
; RUN: not llvm-spirv -r -emit-opaque-pointers %t.spv -spec-const "101:i32:1024" 2>&1 | FileCheck %s --check-prefix=CHECK-VALUE
4444
; CHECK-VALUE: CL_INVALID_VALUE. In "101:i32:1024": Size of type i32 (4 bytes) does not match the size of the specialization constant in the module (1 bytes)
4545

46-
; RUN: llvm-spirv -r -o - %t.spv | llvm-dis | FileCheck %s --check-prefix=CHECK-DEFAULT
47-
; RUN: llvm-spirv -r -spec-const "101:i8:42 102:i16:22 103:i32:33 104:i64:44 105:i8:0 106:i1:0 107:i1:1 108:f16:5.5 109:f32:6.6 110:f64:7.7 111:f64:8.8 101:i8:11" -o - %t.spv | llvm-dis | FileCheck %s --check-prefix=CHECK-SPEC
46+
; RUN: llvm-spirv -r -emit-opaque-pointers -o - %t.spv | llvm-dis | FileCheck %s --check-prefix=CHECK-DEFAULT
47+
; RUN: llvm-spirv -r -emit-opaque-pointers -spec-const "101:i8:42 102:i16:22 103:i32:33 104:i64:44 105:i8:0 106:i1:0 107:i1:1 108:f16:5.5 109:f32:6.6 110:f64:7.7 111:f64:8.8 101:i8:11" -o - %t.spv | llvm-dis | FileCheck %s --check-prefix=CHECK-SPEC
4848

4949
; CHECK-DEFAULT: @bt = addrspace(2) constant i1 true, align 1
5050
; CHECK-DEFAULT: @bf = addrspace(2) constant i1 false, align 1

llvm-spirv/test/SpecConstants/OpSpecConstantComposite.spvasm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111
; CHECK-INFO: Spec const id = 4, size in bytes = 4
1212
; CHECK-INFO: Spec const id = 7, size in bytes = 4
1313

14-
; RUN: llvm-spirv -r -o - %t.spv | llvm-dis -o %t.default.ll
14+
; RUN: llvm-spirv -r -emit-opaque-pointers -o - %t.spv | llvm-dis -o %t.default.ll
1515
; RUN: FileCheck < %t.default.ll %s --check-prefixes=CHECK-COMMON,CHECK-DEFAULT
16-
; RUN: llvm-spirv -r -spec-const "3:i32:42 4:f32:2.71 6:i32:43 7:f32:3.14 10:i32:44 11:i32:55" -o - %t.spv | llvm-dis -o %t.spec.ll
16+
; RUN: llvm-spirv -r -emit-opaque-pointers -spec-const "3:i32:42 4:f32:2.71 6:i32:43 7:f32:3.14 10:i32:44 11:i32:55" -o - %t.spv | llvm-dis -o %t.spec.ll
1717
; RUN: FileCheck < %t.spec.ll %s --check-prefixes=CHECK-COMMON,CHECK-SPEC
1818

1919

2020
; CHECK-COMMON: %struct._ZTS3POD.POD = type { [2 x %struct._ZTS1A.A], %"class._ZTSN2cl4sycl3vecIiLi2EEE.cl::sycl::vec" }
2121
; CHECK-COMMON: %struct._ZTS1A.A = type { i32, float }
2222
; CHECK-COMMON: %"class._ZTSN2cl4sycl3vecIiLi2EEE.cl::sycl::vec" = type { <2 x i32> }
2323

24-
; CHECK-DEFAULT: store %struct._ZTS3POD.POD { [2 x %struct._ZTS1A.A] [%struct._ZTS1A.A { i32 1, float 0.000000e+00 }, %struct._ZTS1A.A { i32 35, float 0.000000e+00 }], %"class._ZTSN2cl4sycl3vecIiLi2EEE.cl::sycl::vec" { <2 x i32> <i32 45, i32 55> } }, %struct._ZTS3POD.POD addrspace(4)* %[[#]]
24+
; CHECK-DEFAULT: store %struct._ZTS3POD.POD { [2 x %struct._ZTS1A.A] [%struct._ZTS1A.A { i32 1, float 0.000000e+00 }, %struct._ZTS1A.A { i32 35, float 0.000000e+00 }], %"class._ZTSN2cl4sycl3vecIiLi2EEE.cl::sycl::vec" { <2 x i32> <i32 45, i32 55> } }, ptr addrspace(4) %[[#]]
2525

26-
; CHECK-SPEC: store %struct._ZTS3POD.POD { [2 x %struct._ZTS1A.A] [%struct._ZTS1A.A { i32 42, float 0x4005AE1480000000 }, %struct._ZTS1A.A { i32 43, float 0x40091EB860000000 }], %"class._ZTSN2cl4sycl3vecIiLi2EEE.cl::sycl::vec" { <2 x i32> <i32 44, i32 55> } }, %struct._ZTS3POD.POD addrspace(4)* %3
26+
; CHECK-SPEC: store %struct._ZTS3POD.POD { [2 x %struct._ZTS1A.A] [%struct._ZTS1A.A { i32 42, float 0x4005AE1480000000 }, %struct._ZTS1A.A { i32 43, float 0x40091EB860000000 }], %"class._ZTSN2cl4sycl3vecIiLi2EEE.cl::sycl::vec" { <2 x i32> <i32 44, i32 55> } }, ptr addrspace(4) %3
2727

2828
; SPIR-V
2929
; Version: 1.1

0 commit comments

Comments
 (0)