summaryrefslogtreecommitdiff
path: root/test/Sema/atomic-expr.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2013-06-10 20:45:12 +0000
committerDimitry Andric <dim@FreeBSD.org>2013-06-10 20:45:12 +0000
commit6a0372513edbc473b538d2f724efac50405d6fef (patch)
tree8f7776b7310bebaf415ac5b69e46e9f928c37144 /test/Sema/atomic-expr.c
parent809500fc2c13c8173a16b052304d983864e4a1e1 (diff)
Notes
Diffstat (limited to 'test/Sema/atomic-expr.c')
-rw-r--r--test/Sema/atomic-expr.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/Sema/atomic-expr.c b/test/Sema/atomic-expr.c
new file mode 100644
index 000000000000..ecc04c4c68d6
--- /dev/null
+++ b/test/Sema/atomic-expr.c
@@ -0,0 +1,47 @@
+// RUN: %clang_cc1 %s -verify -fsyntax-only
+// expected-no-diagnostics
+
+_Atomic(unsigned int) data1;
+int _Atomic data2;
+
+// Shift operations
+
+int func_01 (int x) {
+ return data1 << x;
+}
+
+int func_02 (int x) {
+ return x << data1;
+}
+
+int func_03 (int x) {
+ return data2 << x;
+}
+
+int func_04 (int x) {
+ return x << data2;
+}
+
+int func_05 () {
+ return data2 << data1;
+}
+
+int func_06 () {
+ return data1 << data2;
+}
+
+void func_07 (int x) {
+ data1 <<= x;
+}
+
+void func_08 (int x) {
+ data2 <<= x;
+}
+
+void func_09 (int* xp) {
+ *xp <<= data1;
+}
+
+void func_10 (int* xp) {
+ *xp <<= data2;
+}