summaryrefslogtreecommitdiffstats
path: root/test/SemaOpenCL
diff options
context:
space:
mode:
authorDavid Tweed <david.tweed@arm.com>2013-09-06 09:58:08 +0000
committerDavid Tweed <david.tweed@arm.com>2013-09-06 09:58:08 +0000
commitd7d94dc922075d131d51a4974f60c840e0e96cfb (patch)
treeb2c0a29a7bc3d5223bf0306806fa8a1d4448b6c1 /test/SemaOpenCL
parent2f0a020d29286805e48b74b127fbf153af2c4ce7 (diff)
OpenCL allows the (pre/post)-(increment/decrement) operator on integer vector types,
so allow that case and add appropriate tests. Patch by Ruiling Song! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190129 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaOpenCL')
-rw-r--r--test/SemaOpenCL/vector_inc_dec_ops.cl19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/SemaOpenCL/vector_inc_dec_ops.cl b/test/SemaOpenCL/vector_inc_dec_ops.cl
new file mode 100644
index 0000000000..c65bbcb5b7
--- /dev/null
+++ b/test/SemaOpenCL/vector_inc_dec_ops.cl
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
+// expected-no-diagnostics
+
+typedef __attribute__((ext_vector_type(2))) char char2;
+typedef __attribute__((ext_vector_type(4))) unsigned int uint4;
+typedef __attribute__((ext_vector_type(8))) long long8;
+
+void vectorIncrementDecrementOps()
+{
+ char2 A = (char2)(1);
+ uint4 B = (uint4)(1);
+ long8 C = (long8)(1);
+
+ A++;
+ --A;
+ B--;
+ ++B;
+ C++;
+}