annotate clang/test/Sema/atomic-expr.c @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 1d019706d866
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 %s -verify -fsyntax-only
anatofuz
parents:
diff changeset
2 // expected-no-diagnostics
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 _Atomic(unsigned int) data1;
anatofuz
parents:
diff changeset
5 int _Atomic data2;
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 // Shift operations
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 int func_01 (int x) {
anatofuz
parents:
diff changeset
10 return data1 << x;
anatofuz
parents:
diff changeset
11 }
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 int func_02 (int x) {
anatofuz
parents:
diff changeset
14 return x << data1;
anatofuz
parents:
diff changeset
15 }
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 int func_03 (int x) {
anatofuz
parents:
diff changeset
18 return data2 << x;
anatofuz
parents:
diff changeset
19 }
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 int func_04 (int x) {
anatofuz
parents:
diff changeset
22 return x << data2;
anatofuz
parents:
diff changeset
23 }
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 int func_05 () {
anatofuz
parents:
diff changeset
26 return data2 << data1;
anatofuz
parents:
diff changeset
27 }
anatofuz
parents:
diff changeset
28
anatofuz
parents:
diff changeset
29 int func_06 () {
anatofuz
parents:
diff changeset
30 return data1 << data2;
anatofuz
parents:
diff changeset
31 }
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 void func_07 (int x) {
anatofuz
parents:
diff changeset
34 data1 <<= x;
anatofuz
parents:
diff changeset
35 }
anatofuz
parents:
diff changeset
36
anatofuz
parents:
diff changeset
37 void func_08 (int x) {
anatofuz
parents:
diff changeset
38 data2 <<= x;
anatofuz
parents:
diff changeset
39 }
anatofuz
parents:
diff changeset
40
anatofuz
parents:
diff changeset
41 void func_09 (int* xp) {
anatofuz
parents:
diff changeset
42 *xp <<= data1;
anatofuz
parents:
diff changeset
43 }
anatofuz
parents:
diff changeset
44
anatofuz
parents:
diff changeset
45 void func_10 (int* xp) {
anatofuz
parents:
diff changeset
46 *xp <<= data2;
anatofuz
parents:
diff changeset
47 }
anatofuz
parents:
diff changeset
48
anatofuz
parents:
diff changeset
49 int func_11 (int x) {
anatofuz
parents:
diff changeset
50 return data1 == x;
anatofuz
parents:
diff changeset
51 }
anatofuz
parents:
diff changeset
52
anatofuz
parents:
diff changeset
53 int func_12 () {
anatofuz
parents:
diff changeset
54 return data1 < data2;
anatofuz
parents:
diff changeset
55 }
anatofuz
parents:
diff changeset
56
anatofuz
parents:
diff changeset
57 int func_13 (int x, unsigned y) {
anatofuz
parents:
diff changeset
58 return x ? data1 : y;
anatofuz
parents:
diff changeset
59 }
anatofuz
parents:
diff changeset
60
anatofuz
parents:
diff changeset
61 int func_14 () {
anatofuz
parents:
diff changeset
62 return data1 == 0;
anatofuz
parents:
diff changeset
63 }