r222832 - [OpenCL] Generic address space parsing and diagnostics test (forgotten previously)

Anastasia Stulova anastasia.stulova at arm.com
Wed Nov 26 06:14:05 PST 2014


Author: stulova
Date: Wed Nov 26 08:14:05 2014
New Revision: 222832

URL: http://llvm.org/viewvc/llvm-project?rev=222832&view=rev
Log:
[OpenCL] Generic address space parsing and diagnostics test (forgotten previously)


Added:
    cfe/trunk/test/Parser/opencl-cl20.cl

Added: cfe/trunk/test/Parser/opencl-cl20.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/opencl-cl20.cl?rev=222832&view=auto
==============================================================================
--- cfe/trunk/test/Parser/opencl-cl20.cl (added)
+++ cfe/trunk/test/Parser/opencl-cl20.cl Wed Nov 26 08:14:05 2014
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -DCL20
+
+#ifdef CL20
+// expected-no-diagnostics
+#endif
+
+__generic int * __generic_test(__generic int *arg) {
+  __generic int *var;
+  return var;  
+}
+#ifndef CL20
+// expected-error at -5 {{OpenCL does not support the '__generic' type qualifier}}
+// expected-error at -6 {{OpenCL does not support the '__generic' type qualifier}}
+// expected-error at -6 {{OpenCL does not support the '__generic' type qualifier}}
+#endif
+
+generic int * generic_test(generic int *arg) {
+  generic int *var;
+  return var;  
+}
+#ifndef CL20
+// expected-error at -5 {{OpenCL does not support the 'generic' type qualifier}}
+// expected-error at -6 {{OpenCL does not support the 'generic' type qualifier}}
+// expected-error at -6 {{OpenCL does not support the 'generic' type qualifier}}
+#endif





More information about the cfe-commits mailing list