1// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=clc++
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