annotate clang/test/CodeGenOpenCL/visibility.cl @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 79ff65ed7e25
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
236
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
1 // RUN: %clang_cc1 -std=cl2.0 -fapply-global-visibility-to-externs -fvisibility=default -triple amdgcn-unknown-unknown -S -emit-llvm -o - %s | FileCheck --check-prefix=FVIS-DEFAULT %s
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
2 // RUN: %clang_cc1 -std=cl2.0 -fapply-global-visibility-to-externs -fvisibility=protected -triple amdgcn-unknown-unknown -S -emit-llvm -o - %s | FileCheck --check-prefix=FVIS-PROTECTED %s
c4bab56944e8 LLVM 16
kono
parents: 221
diff changeset
3 // RUN: %clang_cc1 -std=cl2.0 -fapply-global-visibility-to-externs -fvisibility=hidden -triple amdgcn-unknown-unknown -S -emit-llvm -o - %s | FileCheck --check-prefix=FVIS-HIDDEN %s
150
anatofuz
parents:
diff changeset
4
anatofuz
parents:
diff changeset
5 // REQUIRES: amdgpu-registered-target
anatofuz
parents:
diff changeset
6
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
7 // FVIS-DEFAULT: @glob ={{.*}} local_unnamed_addr addrspace(1) global i32 0
150
anatofuz
parents:
diff changeset
8 // FVIS-PROTECTED: @glob = protected local_unnamed_addr
anatofuz
parents:
diff changeset
9 // FVIS-HIDDEN: @glob = hidden local_unnamed_addr
anatofuz
parents:
diff changeset
10 int glob = 0;
anatofuz
parents:
diff changeset
11 // FVIS-DEFAULT: @glob_hidden = hidden local_unnamed_addr
anatofuz
parents:
diff changeset
12 // FVIS-PROTECTED: @glob_hidden = hidden local_unnamed_addr
anatofuz
parents:
diff changeset
13 // FVIS-HIDDEN: @glob_hidden = hidden local_unnamed_addr
anatofuz
parents:
diff changeset
14 __attribute__((visibility("hidden"))) int glob_hidden = 0;
anatofuz
parents:
diff changeset
15 // FVIS-DEFAULT: @glob_protected = protected local_unnamed_addr
anatofuz
parents:
diff changeset
16 // FVIS-PROTECTED: @glob_protected = protected local_unnamed_addr
anatofuz
parents:
diff changeset
17 // FVIS-HIDDEN: @glob_protected = protected local_unnamed_addr
anatofuz
parents:
diff changeset
18 __attribute__((visibility("protected"))) int glob_protected = 0;
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
19 // FVIS-DEFAULT: @glob_default ={{( dso_local)?}} local_unnamed_addr
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
20 // FVIS-PROTECTED: @glob_default ={{( dso_local)?}} local_unnamed_addr
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
21 // FVIS-HIDDEN: @glob_default ={{( dso_local)?}} local_unnamed_addr
150
anatofuz
parents:
diff changeset
22 __attribute__((visibility("default"))) int glob_default = 0;
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 // FVIS-DEFAULT: @ext = external local_unnamed_addr
anatofuz
parents:
diff changeset
25 // FVIS-PROTECTED: @ext = external protected local_unnamed_addr
anatofuz
parents:
diff changeset
26 // FVIS-HIDDEN: @ext = external hidden local_unnamed_addr
anatofuz
parents:
diff changeset
27 extern int ext;
anatofuz
parents:
diff changeset
28 // FVIS-DEFAULT: @ext_hidden = external hidden local_unnamed_addr
anatofuz
parents:
diff changeset
29 // FVIS-PROTECTED: @ext_hidden = external hidden local_unnamed_addr
anatofuz
parents:
diff changeset
30 // FVIS-HIDDEN: @ext_hidden = external hidden local_unnamed_addr
anatofuz
parents:
diff changeset
31 __attribute__((visibility("hidden"))) extern int ext_hidden;
anatofuz
parents:
diff changeset
32 // FVIS-DEFAULT: @ext_protected = external protected local_unnamed_addr
anatofuz
parents:
diff changeset
33 // FVIS-PROTECTED: @ext_protected = external protected local_unnamed_addr
anatofuz
parents:
diff changeset
34 // FVIS-HIDDEN: @ext_protected = external protected local_unnamed_addr
anatofuz
parents:
diff changeset
35 __attribute__((visibility("protected"))) extern int ext_protected;
anatofuz
parents:
diff changeset
36 // FVIS-DEFAULT: @ext_default = external local_unnamed_addr
anatofuz
parents:
diff changeset
37 // FVIS-PROTECTED: @ext_default = external local_unnamed_addr
anatofuz
parents:
diff changeset
38 // FVIS-HIDDEN: @ext_default = external local_unnamed_addr
anatofuz
parents:
diff changeset
39 __attribute__((visibility("default"))) extern int ext_default;
anatofuz
parents:
diff changeset
40
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
41 // FVIS-DEFAULT: define{{.*}} amdgpu_kernel void @kern()
150
anatofuz
parents:
diff changeset
42 // FVIS-PROTECTED: define protected amdgpu_kernel void @kern()
anatofuz
parents:
diff changeset
43 // FVIS-HIDDEN: define protected amdgpu_kernel void @kern()
anatofuz
parents:
diff changeset
44 kernel void kern() {}
anatofuz
parents:
diff changeset
45 // FVIS-DEFAULT: define protected amdgpu_kernel void @kern_hidden()
anatofuz
parents:
diff changeset
46 // FVIS-PROTECTED: define protected amdgpu_kernel void @kern_hidden()
anatofuz
parents:
diff changeset
47 // FVIS-HIDDEN: define protected amdgpu_kernel void @kern_hidden()
anatofuz
parents:
diff changeset
48 __attribute__((visibility("hidden"))) kernel void kern_hidden() {}
anatofuz
parents:
diff changeset
49 // FVIS-DEFAULT: define protected amdgpu_kernel void @kern_protected()
anatofuz
parents:
diff changeset
50 // FVIS-PROTECTED: define protected amdgpu_kernel void @kern_protected()
anatofuz
parents:
diff changeset
51 // FVIS-HIDDEN: define protected amdgpu_kernel void @kern_protected()
anatofuz
parents:
diff changeset
52 __attribute__((visibility("protected"))) kernel void kern_protected() {}
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
53 // FVIS-DEFAULT: define{{.*}} amdgpu_kernel void @kern_default()
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
54 // FVIS-PROTECTED: define{{.*}} amdgpu_kernel void @kern_default()
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
55 // FVIS-HIDDEN: define{{.*}} amdgpu_kernel void @kern_default()
150
anatofuz
parents:
diff changeset
56 __attribute__((visibility("default"))) kernel void kern_default() {}
anatofuz
parents:
diff changeset
57
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
58 // FVIS-DEFAULT: define{{.*}} void @func()
150
anatofuz
parents:
diff changeset
59 // FVIS-PROTECTED: define protected void @func()
anatofuz
parents:
diff changeset
60 // FVIS-HIDDEN: define hidden void @func()
anatofuz
parents:
diff changeset
61 void func() {}
anatofuz
parents:
diff changeset
62 // FVIS-DEFAULT: define hidden void @func_hidden()
anatofuz
parents:
diff changeset
63 // FVIS-PROTECTED: define hidden void @func_hidden()
anatofuz
parents:
diff changeset
64 // FVIS-HIDDEN: define hidden void @func_hidden()
anatofuz
parents:
diff changeset
65 __attribute__((visibility("hidden"))) void func_hidden() {}
anatofuz
parents:
diff changeset
66 // FVIS-DEFAULT: define protected void @func_protected()
anatofuz
parents:
diff changeset
67 // FVIS-PROTECTED: define protected void @func_protected()
anatofuz
parents:
diff changeset
68 // FVIS-HIDDEN: define protected void @func_protected()
anatofuz
parents:
diff changeset
69 __attribute__((visibility("protected"))) void func_protected() {}
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
70 // FVIS-DEFAULT: define{{.*}} void @func_default()
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
71 // FVIS-PROTECTED: define{{.*}} void @func_default()
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
72 // FVIS-HIDDEN: define{{.*}} void @func_default()
150
anatofuz
parents:
diff changeset
73 __attribute__((visibility("default"))) void func_default() {}
anatofuz
parents:
diff changeset
74
anatofuz
parents:
diff changeset
75 extern kernel void ext_kern();
anatofuz
parents:
diff changeset
76 __attribute__((visibility("hidden"))) extern kernel void ext_kern_hidden();
anatofuz
parents:
diff changeset
77 __attribute__((visibility("protected"))) extern kernel void ext_kern_protected();
anatofuz
parents:
diff changeset
78 __attribute__((visibility("default"))) extern kernel void ext_kern_default();
anatofuz
parents:
diff changeset
79
anatofuz
parents:
diff changeset
80 extern void ext_func();
anatofuz
parents:
diff changeset
81 __attribute__((visibility("hidden"))) extern void ext_func_hidden();
anatofuz
parents:
diff changeset
82 __attribute__((visibility("protected"))) extern void ext_func_protected();
anatofuz
parents:
diff changeset
83 __attribute__((visibility("default"))) extern void ext_func_default();
anatofuz
parents:
diff changeset
84
anatofuz
parents:
diff changeset
85 void use() {
anatofuz
parents:
diff changeset
86 glob = ext + ext_hidden + ext_protected + ext_default;
anatofuz
parents:
diff changeset
87 ext_kern();
anatofuz
parents:
diff changeset
88 ext_kern_hidden();
anatofuz
parents:
diff changeset
89 ext_kern_protected();
anatofuz
parents:
diff changeset
90 ext_kern_default();
anatofuz
parents:
diff changeset
91 ext_func();
anatofuz
parents:
diff changeset
92 ext_func_hidden();
anatofuz
parents:
diff changeset
93 ext_func_protected();
anatofuz
parents:
diff changeset
94 ext_func_default();
anatofuz
parents:
diff changeset
95 }
anatofuz
parents:
diff changeset
96
anatofuz
parents:
diff changeset
97 // FVIS-DEFAULT: declare amdgpu_kernel void @ext_kern()
anatofuz
parents:
diff changeset
98 // FVIS-PROTECTED: declare protected amdgpu_kernel void @ext_kern()
anatofuz
parents:
diff changeset
99 // FVIS-HIDDEN: declare protected amdgpu_kernel void @ext_kern()
anatofuz
parents:
diff changeset
100
anatofuz
parents:
diff changeset
101 // FVIS-DEFAULT: declare protected amdgpu_kernel void @ext_kern_hidden()
anatofuz
parents:
diff changeset
102 // FVIS-PROTECTED: declare protected amdgpu_kernel void @ext_kern_hidden()
anatofuz
parents:
diff changeset
103 // FVIS-HIDDEN: declare protected amdgpu_kernel void @ext_kern_hidden()
anatofuz
parents:
diff changeset
104
anatofuz
parents:
diff changeset
105 // FVIS-DEFAULT: declare protected amdgpu_kernel void @ext_kern_protected()
anatofuz
parents:
diff changeset
106 // FVIS-PROTECTED: declare protected amdgpu_kernel void @ext_kern_protected()
anatofuz
parents:
diff changeset
107 // FVIS-HIDDEN: declare protected amdgpu_kernel void @ext_kern_protected()
anatofuz
parents:
diff changeset
108
anatofuz
parents:
diff changeset
109 // FVIS-DEFAULT: declare amdgpu_kernel void @ext_kern_default()
anatofuz
parents:
diff changeset
110 // FVIS-PROTECTED: declare amdgpu_kernel void @ext_kern_default()
anatofuz
parents:
diff changeset
111 // FVIS-HIDDEN: declare amdgpu_kernel void @ext_kern_default()
anatofuz
parents:
diff changeset
112
anatofuz
parents:
diff changeset
113
anatofuz
parents:
diff changeset
114 // FVIS-DEFAULT: declare void @ext_func()
anatofuz
parents:
diff changeset
115 // FVIS-PROTECTED: declare protected void @ext_func()
anatofuz
parents:
diff changeset
116 // FVIS-HIDDEN: declare hidden void @ext_func()
anatofuz
parents:
diff changeset
117
anatofuz
parents:
diff changeset
118 // FVIS-DEFAULT: declare hidden void @ext_func_hidden()
anatofuz
parents:
diff changeset
119 // FVIS-PROTECTED: declare hidden void @ext_func_hidden()
anatofuz
parents:
diff changeset
120 // FVIS-HIDDEN: declare hidden void @ext_func_hidden()
anatofuz
parents:
diff changeset
121
anatofuz
parents:
diff changeset
122 // FVIS-DEFAULT: declare protected void @ext_func_protected()
anatofuz
parents:
diff changeset
123 // FVIS-PROTECTED: declare protected void @ext_func_protected()
anatofuz
parents:
diff changeset
124 // FVIS-HIDDEN: declare protected void @ext_func_protected()
anatofuz
parents:
diff changeset
125
anatofuz
parents:
diff changeset
126 // FVIS-DEFAULT: declare void @ext_func_default()
anatofuz
parents:
diff changeset
127 // FVIS-PROTECTED: declare void @ext_func_default()
anatofuz
parents:
diff changeset
128 // FVIS-HIDDEN: declare void @ext_func_default()