Douglas Gregor | 236d9d16 | 2013-04-16 15:41:08 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 %s -verify -fsyntax-only |
2 | // expected-no-diagnostics | ||||
3 | |||||
4 | _Atomic(unsigned int) data1; | ||||
5 | int _Atomic data2; | ||||
6 | |||||
7 | // Shift operations | ||||
8 | |||||
9 | int func_01 (int x) { | ||||
10 | return data1 << x; | ||||
11 | } | ||||
12 | |||||
13 | int func_02 (int x) { | ||||
14 | return x << data1; | ||||
15 | } | ||||
16 | |||||
17 | int func_03 (int x) { | ||||
18 | return data2 << x; | ||||
19 | } | ||||
20 | |||||
21 | int func_04 (int x) { | ||||
22 | return x << data2; | ||||
23 | } | ||||
24 | |||||
25 | int func_05 () { | ||||
26 | return data2 << data1; | ||||
27 | } | ||||
28 | |||||
29 | int func_06 () { | ||||
30 | return data1 << data2; | ||||
31 | } | ||||
32 | |||||
33 | void func_07 (int x) { | ||||
34 | data1 <<= x; | ||||
35 | } | ||||
36 | |||||
37 | void func_08 (int x) { | ||||
38 | data2 <<= x; | ||||
39 | } | ||||
40 | |||||
41 | void func_09 (int* xp) { | ||||
42 | *xp <<= data1; | ||||
43 | } | ||||
44 | |||||
45 | void func_10 (int* xp) { | ||||
46 | *xp <<= data2; | ||||
47 | } |