Skip to content

Commit aaba505

Browse files
committed
Keep better test coverage when spirv-tools not present
1 parent 6fb0416 commit aaba505

File tree

2 files changed

+90
-16
lines changed

2 files changed

+90
-16
lines changed

llvm/test/CodeGen/SPIRV/basic_int_types.ll

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,73 @@
1-
; REQUIRES: spirv-tools
2-
; RUN: llc -O0 -mtriple=spirv-unknown-unknown %s -o - --filetype=obj | spirv-dis | FileCheck %s
3-
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - --filetype=obj | spirv-dis | FileCheck %s
4-
; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - --filetype=obj | spirv-dis | FileCheck %s
1+
; RUN: llc -O0 -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s
2+
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
3+
; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
4+
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o - -filetype=obj | spirv-val %}
55

66
define void @main() {
77
entry:
8-
; CHECK: %int16_t_Val = OpVariable %_ptr_Function_ushort Function
8+
; CHECK-DAG: %[[#short:]] = OpTypeInt 16 0
9+
; CHECK-DAG: %[[#int:]] = OpTypeInt 32 0
10+
; CHECK-DAG: %[[#long:]] = OpTypeInt 64 0
11+
12+
; CHECK-DAG: %[[#v2short:]] = OpTypeVector %[[#short]] 2
13+
; CHECK-DAG: %[[#v3short:]] = OpTypeVector %[[#short]] 3
14+
; CHECK-DAG: %[[#v4short:]] = OpTypeVector %[[#short]] 4
15+
16+
; CHECK-DAG: %[[#v2int:]] = OpTypeVector %[[#int]] 2
17+
; CHECK-DAG: %[[#v3int:]] = OpTypeVector %[[#int]] 3
18+
; CHECK-DAG: %[[#v4int:]] = OpTypeVector %[[#int]] 4
19+
20+
; CHECK-DAG: %[[#v2long:]] = OpTypeVector %[[#long]] 2
21+
; CHECK-DAG: %[[#v3long:]] = OpTypeVector %[[#long]] 3
22+
; CHECK-DAG: %[[#v4long:]] = OpTypeVector %[[#long]] 4
23+
24+
; CHECK-DAG: %[[#ptr_Function_short:]] = OpTypePointer Function %[[#short]]
25+
; CHECK-DAG: %[[#ptr_Function_int:]] = OpTypePointer Function %[[#int]]
26+
; CHECK-DAG: %[[#ptr_Function_long:]] = OpTypePointer Function %[[#long]]
27+
; CHECK-DAG: %[[#ptr_Function_v2short:]] = OpTypePointer Function %[[#v2short]]
28+
; CHECK-DAG: %[[#ptr_Function_v3short:]] = OpTypePointer Function %[[#v3short]]
29+
; CHECK-DAG: %[[#ptr_Function_v4short:]] = OpTypePointer Function %[[#v4short]]
30+
; CHECK-DAG: %[[#ptr_Function_v2int:]] = OpTypePointer Function %[[#v2int]]
31+
; CHECK-DAG: %[[#ptr_Function_v3int:]] = OpTypePointer Function %[[#v3int]]
32+
; CHECK-DAG: %[[#ptr_Function_v4int:]] = OpTypePointer Function %[[#v4int]]
33+
; CHECK-DAG: %[[#ptr_Function_v2long:]] = OpTypePointer Function %[[#v2long]]
34+
; CHECK-DAG: %[[#ptr_Function_v3long:]] = OpTypePointer Function %[[#v3long]]
35+
; CHECK-DAG: %[[#ptr_Function_v4long:]] = OpTypePointer Function %[[#v4long]]
36+
37+
; CHECK: %[[#]] = OpVariable %[[#ptr_Function_short]] Function
938
%int16_t_Val = alloca i16, align 2
1039

11-
; CHECK: %int_Val = OpVariable %_ptr_Function_uint Function
40+
; CHECK: %[[#]] = OpVariable %[[#ptr_Function_int]] Function
1241
%int_Val = alloca i32, align 4
1342

14-
; CHECK: %int64_t_Val = OpVariable %_ptr_Function_ulong Function
43+
; CHECK: %[[#]] = OpVariable %[[#ptr_Function_long]] Function
1544
%int64_t_Val = alloca i64, align 8
1645

17-
; CHECK: %int16_t2_Val = OpVariable %_ptr_Function_v2ushort Function
46+
; CHECK: %[[#]] = OpVariable %[[#ptr_Function_v2short]] Function
1847
%int16_t2_Val = alloca <2 x i16>, align 4
1948

20-
; CHECK: %int16_t3_Val = OpVariable %_ptr_Function_v3ushort Function
49+
; CHECK: %[[#]] = OpVariable %[[#ptr_Function_v3short]] Function
2150
%int16_t3_Val = alloca <3 x i16>, align 8
2251

23-
; CHECK: %int16_t4_Val = OpVariable %_ptr_Function_v4ushort Function
52+
; CHECK: %[[#]] = OpVariable %[[#ptr_Function_v4short]] Function
2453
%int16_t4_Val = alloca <4 x i16>, align 8
2554

26-
; CHECK: %int2_Val = OpVariable %_ptr_Function_v2uint Function
55+
; CHECK: %[[#]] = OpVariable %[[#ptr_Function_v2int]] Function
2756
%int2_Val = alloca <2 x i32>, align 8
2857

29-
; CHECK: %int3_Val = OpVariable %_ptr_Function_v3uint Function
58+
; CHECK: %[[#]] = OpVariable %[[#ptr_Function_v3int]] Function
3059
%int3_Val = alloca <3 x i32>, align 16
3160

32-
; CHECK: %int4_Val = OpVariable %_ptr_Function_v4uint Function
61+
; CHECK: %[[#]] = OpVariable %[[#ptr_Function_v4int]] Function
3362
%int4_Val = alloca <4 x i32>, align 16
3463

35-
; CHECK: %int64_t2_Val = OpVariable %_ptr_Function_v2ulong Function
64+
; CHECK: %[[#]] = OpVariable %[[#ptr_Function_v2long]] Function
3665
%int64_t2_Val = alloca <2 x i64>, align 16
3766

38-
; CHECK: %int64_t3_Val = OpVariable %_ptr_Function_v3ulong Function
67+
; CHECK: %[[#]] = OpVariable %[[#ptr_Function_v3long]] Function
3968
%int64_t3_Val = alloca <3 x i64>, align 32
4069

41-
; CHECK: %int64_t4_Val = OpVariable %_ptr_Function_v4ulong Function
70+
; CHECK: %[[#]] = OpVariable %[[#ptr_Function_v4long]] Function
4271
%int64_t4_Val = alloca <4 x i64>, align 32
4372

4473
ret void
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
; REQUIRES: spirv-tools
2+
; RUN: llc -O0 -mtriple=spirv-unknown-unknown %s -o - --filetype=obj | spirv-dis | FileCheck %s
3+
; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - --filetype=obj | spirv-dis | FileCheck %s
4+
; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - --filetype=obj | spirv-dis | FileCheck %s
5+
6+
define void @main() {
7+
entry:
8+
; CHECK: %int16_t_Val = OpVariable %_ptr_Function_ushort Function
9+
%int16_t_Val = alloca i16, align 2
10+
11+
; CHECK: %int_Val = OpVariable %_ptr_Function_uint Function
12+
%int_Val = alloca i32, align 4
13+
14+
; CHECK: %int64_t_Val = OpVariable %_ptr_Function_ulong Function
15+
%int64_t_Val = alloca i64, align 8
16+
17+
; CHECK: %int16_t2_Val = OpVariable %_ptr_Function_v2ushort Function
18+
%int16_t2_Val = alloca <2 x i16>, align 4
19+
20+
; CHECK: %int16_t3_Val = OpVariable %_ptr_Function_v3ushort Function
21+
%int16_t3_Val = alloca <3 x i16>, align 8
22+
23+
; CHECK: %int16_t4_Val = OpVariable %_ptr_Function_v4ushort Function
24+
%int16_t4_Val = alloca <4 x i16>, align 8
25+
26+
; CHECK: %int2_Val = OpVariable %_ptr_Function_v2uint Function
27+
%int2_Val = alloca <2 x i32>, align 8
28+
29+
; CHECK: %int3_Val = OpVariable %_ptr_Function_v3uint Function
30+
%int3_Val = alloca <3 x i32>, align 16
31+
32+
; CHECK: %int4_Val = OpVariable %_ptr_Function_v4uint Function
33+
%int4_Val = alloca <4 x i32>, align 16
34+
35+
; CHECK: %int64_t2_Val = OpVariable %_ptr_Function_v2ulong Function
36+
%int64_t2_Val = alloca <2 x i64>, align 16
37+
38+
; CHECK: %int64_t3_Val = OpVariable %_ptr_Function_v3ulong Function
39+
%int64_t3_Val = alloca <3 x i64>, align 32
40+
41+
; CHECK: %int64_t4_Val = OpVariable %_ptr_Function_v4ulong Function
42+
%int64_t4_Val = alloca <4 x i64>, align 32
43+
44+
ret void
45+
}

0 commit comments

Comments
 (0)