xref: /llvm-project/clang/test/SemaOpenCLCXX/address_space_overloading.clcpp (revision d1c8a151df830c6c727f0bb7d33774bd3eb96824)
1// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
2// expected-no-diagnostics
3
4struct RetGlob {
5  int dummy;
6};
7
8struct RetGen {
9  char dummy;
10};
11
12RetGlob foo(const __global int *);
13RetGen foo(const __generic int *);
14
15void kernel k() {
16  __global int *ArgGlob;
17  __generic int *ArgGen;
18  __local int *ArgLoc;
19  RetGlob TestGlob = foo(ArgGlob);
20  RetGen TestGen = foo(ArgGen);
21  TestGen = foo(ArgLoc);
22}
23