diff options
author | Douglas Gregor <dgregor@apple.com> | 2013-04-16 15:41:08 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2013-04-16 15:41:08 +0000 |
commit | 236d9d16c9b42001085611a82d37b9d5a4f39c1f (patch) | |
tree | 40679ec59e0e5e4f7e1afbd54768a233bf0ec4f1 /test/Sema | |
parent | 428edb7f7599b4ee44eaad00bb3c330495fc1ad6 (diff) |
Fix handling of atomic shift operations, from Serge Pavlov.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179600 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema')
-rw-r--r-- | test/Sema/atomic-expr.c | 47 |
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 0000000000..ecc04c4c68 --- /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; +} |