diff options
Diffstat (limited to 'test/SemaOpenCL/predefined-expr.cl')
-rw-r--r-- | test/SemaOpenCL/predefined-expr.cl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaOpenCL/predefined-expr.cl b/test/SemaOpenCL/predefined-expr.cl new file mode 100644 index 000000000000..419e7a925c5c --- /dev/null +++ b/test/SemaOpenCL/predefined-expr.cl @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 %s -verify +// RUN: %clang_cc1 %s -verify -cl-std=CL2.0 + +void f() { + char *f1 = __func__; //expected-error-re{{initializing '{{__generic char|char}} *' with an expression of type 'const __constant char *' changes address space of pointer}} + constant char *f2 = __func__; //expected-warning{{initializing '__constant char *' with an expression of type 'const __constant char [2]' discards qualifiers}} + constant const char *f3 = __func__; +} |