[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGenSYCL / address-space-mangling.cpp
blob868bf8ccbdcf87df3cfc816632932ac43c9ea0d6
1 // RUN: %clang_cc1 -triple spir64 -fsycl-is-device -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s --check-prefix=SPIR
2 // RUN: %clang_cc1 -triple x86_64 -fsycl-is-device -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s --check-prefix=X86
4 // REQUIRES: x86-registered-target
6 void foo(__attribute__((opencl_global)) int *);
7 void foo(__attribute__((opencl_local)) int *);
8 void foo(__attribute__((opencl_private)) int *);
9 void foo(int *);
11 // SPIR: declare spir_func void @_Z3fooPU3AS1i(ptr addrspace(1) noundef) #1
12 // SPIR: declare spir_func void @_Z3fooPU3AS3i(ptr addrspace(3) noundef) #1
13 // SPIR: declare spir_func void @_Z3fooPU3AS0i(ptr noundef) #1
14 // SPIR: declare spir_func void @_Z3fooPi(ptr addrspace(4) noundef) #1
16 // X86: declare void @_Z3fooPU8SYglobali(ptr noundef) #1
17 // X86: declare void @_Z3fooPU7SYlocali(ptr noundef) #1
18 // X86: declare void @_Z3fooPU9SYprivatei(ptr noundef) #1
19 // X86: declare void @_Z3fooPi(ptr noundef) #1
21 void test() {
22 __attribute__((opencl_global)) int *glob;
23 __attribute__((opencl_local)) int *loc;
24 __attribute__((opencl_private)) int *priv;
25 int *def;
26 foo(glob);
27 foo(loc);
28 foo(priv);
29 foo(def);