]> granicus.if.org Git - clang/blob - test/SemaOpenCL/overload_addrspace_resolution.cl
fa7b6144a20697eb2a61595ccbe9be9ec8260ea6
[clang] / test / SemaOpenCL / overload_addrspace_resolution.cl
1 // RUN: %clang_cc1 -cl-std=CL2.0 -emit-llvm -o - %s | FileCheck %s
2
3 void __attribute__((overloadable)) foo(global int *a, global int *b);
4 void __attribute__((overloadable)) foo(generic int *a, generic int *b);
5 void __attribute__((overloadable)) bar(generic int *global *a, generic int *global *b);
6 void __attribute__((overloadable)) bar(generic int *generic *a, generic int *generic *b);
7
8 void kernel ker() {
9   global int *a;
10   global int *b;
11   generic int *c;
12   local int *d;
13   generic int *generic *gengen;
14   generic int *local *genloc;
15   generic int *global *genglob;
16   // CHECK: call void @_Z3fooPU8CLglobaliS0_(i32* undef, i32* undef)
17   foo(a, b);
18   // CHECK: call void @_Z3fooPU9CLgenericiS0_(i32* undef, i32* undef)
19   foo(b, c);
20   // CHECK: call void @_Z3fooPU9CLgenericiS0_(i32* undef, i32* undef)
21   foo(a, d);
22
23   // CHECK: call void @_Z3barPU9CLgenericPU9CLgenericiS2_(i32** undef, i32** undef)
24   bar(gengen, genloc);
25   // CHECK: call void @_Z3barPU9CLgenericPU9CLgenericiS2_(i32** undef, i32** undef)
26   bar(gengen, genglob);
27   // CHECK: call void @_Z3barPU8CLglobalPU9CLgenericiS2_(i32** undef, i32** undef)
28   bar(genglob, genglob);
29 }