Debian Codegraph @

llvm/test/CodeGen/SPIRV/global-var-name-align.ll

raw
1 ; Check names and decoration of global variables.
2
3 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s -check-prefixes=CHECK,OCL
4 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
5
6 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s -check-prefixes=CHECK,OCL
7 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}
8
9 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-vulkan %s -o - | FileCheck %s -check-prefixes=CHECK,VK
10 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan %s -o - -filetype=obj | spirv-val %}
11
12 ; CHECK-DAG: OpName %[[#id18:]] "G1"
13 ; CHECK-DAG: OpName %[[#id22:]] "g1"
14 ; CHECK-DAG: OpName %[[#id23:]] "g2"
15 ; CHECK-DAG: OpName %[[#id27:]] "g4"
16 ; CHECK-DAG: OpName %[[#id30:]] "c1"
17 ; CHECK-DAG: OpName %[[#id31:]] "n_t"
18 ; CHECK-DAG: OpName %[[#id32:]] "w"
19 ; CHECK-DAG: OpName %[[#id34:]] "a.b"
20 ; CHECK-DAG: OpName %[[#id35:]] "e"
21 ; CHECK-DAG: OpName %[[#id36:]] "y.z"
22 ; CHECK-DAG: OpName %[[#id38:]] "x"
23
24 ; CHECK-NOT: OpDecorate %[[#id18]] LinkageAttributes
25 ; OCL-DAG: OpDecorate %[[#id18]] Constant
26 ; OCL-DAG: OpDecorate %[[#id22]] Alignment 4
27 ; VK-NOT: OpDecorate {{.*}} Constant
28 ; VK-NOT: OpDecorate {{.*}} Alignment
29 ; CHECK-DAG: OpDecorate %[[#id22]] LinkageAttributes "g1" Export
30 ; OCL-DAG: OpDecorate %[[#id23]] Alignment 4
31 ; OCL-DAG: OpDecorate %[[#id27]] Alignment 4
32 ; VK-NOT: OpDecorate {{.*}} Constant
33 ; VK-NOT: OpDecorate {{.*}} Alignment
34 ; CHECK-DAG: OpDecorate %[[#id27]] LinkageAttributes "g4" Export
35 ; OCL-DAG: OpDecorate %[[#id30]] Constant
36 ; OCL-DAG: OpDecorate %[[#id30]] Alignment 4
37 ; VK-NOT: OpDecorate {{.*}} Constant
38 ; VK-NOT: OpDecorate {{.*}} Alignment
39 ; CHECK-DAG: OpDecorate %[[#id30]] LinkageAttributes "c1" Export
40 ; OCL-DAG: OpDecorate %[[#id31]] Constant
41 ; VK-NOT: OpDecorate {{.*}} Constant
42 ; VK-NOT: OpDecorate {{.*}} Alignment
43 ; CHECK-DAG: OpDecorate %[[#id31]] LinkageAttributes "n_t" Import
44 ; OCL-DAG: OpDecorate %[[#id32]] Constant
45 ; OCL-DAG: OpDecorate %[[#id32]] Alignment 4
46 ; VK-NOT: OpDecorate {{.*}} Constant
47 ; VK-NOT: OpDecorate {{.*}} Alignment
48 ; CHECK-DAG: OpDecorate %[[#id32]] LinkageAttributes "w" Export
49 ; OCL-DAG: OpDecorate %[[#id34]] Constant
50 ; OCL-DAG: OpDecorate %[[#id34]] Alignment 4
51 ; VK-NOT: OpDecorate {{.*}} Constant
52 ; VK-NOT: OpDecorate {{.*}} Alignment
53 ; CHECK-DAG: OpDecorate %[[#id35]] LinkageAttributes "e" Import
54 ; OCL-DAG: OpDecorate %[[#id36]] Alignment 4
55 ; OCL-DAG: OpDecorate %[[#id38]] Constant
56 ; OCL-DAG: OpDecorate %[[#id38]] Alignment 4
57 ; VK-NOT: OpDecorate {{.*}} Constant
58 ; VK-NOT: OpDecorate {{.*}} Alignment
59
60 %"class.sycl::_V1::nd_item" = type { i8 }
61
62 @G1 = private unnamed_addr addrspace(1) constant %"class.sycl::_V1::nd_item" poison, align 1
63 @g1 = addrspace(1) global i32 1, align 4
64 @g2 = internal addrspace(1) global i32 2, align 4
65 @g4 = common addrspace(1) global i32 0, align 4
66 @c1 = addrspace(2) constant [2 x i32] [i32 0, i32 1], align 4
67 @n_t = external addrspace(2) constant [256 x i32]
68 @w = addrspace(1) constant i32 0, align 4
69 @a.b = internal addrspace(2) constant [2 x i32] [i32 2, i32 3], align 4
70 @e = external addrspace(1) global i32
71 @y.z = internal addrspace(1) global i32 0, align 4
72 @x = internal addrspace(2) constant float 1.000000e+00, align 4
73
74 define internal spir_func void @foo() {
75 ret void
76 }