annotate clang/test/CodeGen/PR8880.c @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -Wno-gcc-compat -emit-llvm -o - %s | FileCheck %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 void pr8880_cg_1(int *iptr) {
anatofuz
parents:
diff changeset
4 // CHECK-LABEL: define {{.*}}void @pr8880_cg_1(
anatofuz
parents:
diff changeset
5 int i, j;
anatofuz
parents:
diff changeset
6 // CHECK: br label %[[OUTER_COND:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
7 for (i = 2; i != 10 ; i++ )
anatofuz
parents:
diff changeset
8 // CHECK: [[OUTER_COND]]
anatofuz
parents:
diff changeset
9 // CHECK: label %[[OUTER_BODY:[0-9A-Za-z$._]+]], label %[[OUTER_END:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
10 // CHECK: [[OUTER_BODY]]
anatofuz
parents:
diff changeset
11 // CHECK: br label %[[INNER_COND:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
12 for (j = 3 ; j < 22; (void)({ ++j; break; j;})) {
anatofuz
parents:
diff changeset
13 // CHECK: [[INNER_COND]]
anatofuz
parents:
diff changeset
14 // CHECK: label %[[INNER_BODY:[0-9A-Za-z$._]+]], label %[[INNER_END:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
15 // CHECK: [[INNER_BODY]]
anatofuz
parents:
diff changeset
16 *iptr = 7;
anatofuz
parents:
diff changeset
17 // CHECK: store i32 7,
anatofuz
parents:
diff changeset
18 // CHECK: br label %[[INNER_INC:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
19 // CHECK: [[INNER_INC]]
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 // break in 3rd expression of inner loop causes branch to end of inner loop
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 // CHECK: br label %[[INNER_END:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
24 // CHECK: [[INNER_END]]
anatofuz
parents:
diff changeset
25 }
anatofuz
parents:
diff changeset
26 // CHECK: br label %[[OUTER_INC:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
27 // CHECK: [[OUTER_INC]]
anatofuz
parents:
diff changeset
28 // CHECK: br label %[[OUTER_COND]]
anatofuz
parents:
diff changeset
29 // CHECK: [[OUTER_END]]
anatofuz
parents:
diff changeset
30 // CHECK: ret
anatofuz
parents:
diff changeset
31 }
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 void pr8880_cg_2(int *iptr) {
anatofuz
parents:
diff changeset
34 // CHECK-LABEL: define {{.*}}void @pr8880_cg_2(
anatofuz
parents:
diff changeset
35 int i, j;
anatofuz
parents:
diff changeset
36 // CHECK: br label %[[OUTER_COND:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
37 for (i = 2; i != 10 ; i++ )
anatofuz
parents:
diff changeset
38 // CHECK: [[OUTER_COND]]
anatofuz
parents:
diff changeset
39 // CHECK: label %[[OUTER_BODY:[0-9A-Za-z$._]+]], label %[[OUTER_END:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
40 // CHECK: [[OUTER_BODY]]
anatofuz
parents:
diff changeset
41 // CHECK: br label %[[INNER_COND:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
42 for (j = 3 ; j < 22; (void)({ ++j; continue; j;})) {
anatofuz
parents:
diff changeset
43 // CHECK: [[INNER_COND]]
anatofuz
parents:
diff changeset
44 // CHECK: label %[[INNER_BODY:[0-9A-Za-z$._]+]], label %[[INNER_END:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
45 // CHECK: [[INNER_BODY]]
anatofuz
parents:
diff changeset
46 *iptr = 7;
anatofuz
parents:
diff changeset
47 // CHECK: store i32 7,
anatofuz
parents:
diff changeset
48 // CHECK: br label %[[INNER_INC:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
49 // CHECK: [[INNER_INC]]
anatofuz
parents:
diff changeset
50
anatofuz
parents:
diff changeset
51 // continue in 3rd expression of inner loop causes branch to inc of inner loop
anatofuz
parents:
diff changeset
52
anatofuz
parents:
diff changeset
53 // CHECK: br label %[[INNER_INC]]
anatofuz
parents:
diff changeset
54 // CHECK: [[INNER_END]]
anatofuz
parents:
diff changeset
55 }
anatofuz
parents:
diff changeset
56 // CHECK: br label %[[OUTER_INC:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
57 // CHECK: [[OUTER_INC]]
anatofuz
parents:
diff changeset
58 // CHECK: br label %[[OUTER_COND]]
anatofuz
parents:
diff changeset
59 // CHECK: [[OUTER_END]]
anatofuz
parents:
diff changeset
60 // CHECK: ret
anatofuz
parents:
diff changeset
61 }
anatofuz
parents:
diff changeset
62
anatofuz
parents:
diff changeset
63 void pr8880_cg_3(int *iptr) {
anatofuz
parents:
diff changeset
64 // CHECK-LABEL: define {{.*}}void @pr8880_cg_3(
anatofuz
parents:
diff changeset
65 int i, j;
anatofuz
parents:
diff changeset
66 // CHECK: br label %[[OUTER_COND:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
67 for (i = 2 ; i != 10 ; i++ )
anatofuz
parents:
diff changeset
68 // CHECK: [[OUTER_COND]]
anatofuz
parents:
diff changeset
69 // CHECK: label %[[OUTER_BODY:[0-9A-Za-z$._]+]], label %[[OUTER_END:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
70 // CHECK: [[OUTER_BODY]]
anatofuz
parents:
diff changeset
71 // CHECK: br label %[[INNER_COND:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
72 for (j = 3 ; ({break; j;}); j++) {
anatofuz
parents:
diff changeset
73
anatofuz
parents:
diff changeset
74 // break in 2nd expression of inner loop causes branch to end of inner loop
anatofuz
parents:
diff changeset
75
anatofuz
parents:
diff changeset
76 // CHECK: [[INNER_COND]]
anatofuz
parents:
diff changeset
77 // CHECK: br label %[[INNER_END:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
78 // CHECK: label %[[INNER_BODY:[0-9A-Za-z$._]+]], label %[[INNER_END:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
79 // CHECK: [[INNER_BODY]]
anatofuz
parents:
diff changeset
80 *iptr = 7;
anatofuz
parents:
diff changeset
81 // CHECK: store i32 7,
anatofuz
parents:
diff changeset
82 // CHECK: br label %[[INNER_INC:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
83 // CHECK: [[INNER_INC]]
anatofuz
parents:
diff changeset
84 // CHECK: br label %[[INNER_COND]]
anatofuz
parents:
diff changeset
85 }
anatofuz
parents:
diff changeset
86 // CHECK: [[INNER_END]]
anatofuz
parents:
diff changeset
87 // CHECK: br label %[[OUTER_INC:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
88 // CHECK: [[OUTER_INC]]
anatofuz
parents:
diff changeset
89 // CHECK: br label %[[OUTER_COND]]
anatofuz
parents:
diff changeset
90 // CHECK: [[OUTER_END]]
anatofuz
parents:
diff changeset
91 // CHECK: ret
anatofuz
parents:
diff changeset
92 }
anatofuz
parents:
diff changeset
93
anatofuz
parents:
diff changeset
94 void pr8880_cg_4(int *iptr) {
anatofuz
parents:
diff changeset
95 // CHECK-LABEL: define {{.*}}void @pr8880_cg_4(
anatofuz
parents:
diff changeset
96 int i, j;
anatofuz
parents:
diff changeset
97 // CHECK: br label %[[OUTER_COND:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
98 for (i = 2 ; i != 10 ; i++ )
anatofuz
parents:
diff changeset
99 // CHECK: [[OUTER_COND]]
anatofuz
parents:
diff changeset
100 // CHECK: label %[[OUTER_BODY:[0-9A-Za-z$._]+]], label %[[OUTER_END:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
101 // CHECK: [[OUTER_BODY]]
anatofuz
parents:
diff changeset
102 // CHECK: br label %[[INNER_COND:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
103 for (j = 3 ; ({continue; j;}); j++) {
anatofuz
parents:
diff changeset
104
anatofuz
parents:
diff changeset
105 // continue in 2nd expression of inner loop causes branch to inc of inner loop
anatofuz
parents:
diff changeset
106
anatofuz
parents:
diff changeset
107 // CHECK: [[INNER_COND]]
anatofuz
parents:
diff changeset
108 // CHECK: br label %[[INNER_INC:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
109 // CHECK: label %[[INNER_BODY:[0-9A-Za-z$._]+]], label %[[INNER_END:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
110 // CHECK: [[INNER_BODY]]
anatofuz
parents:
diff changeset
111 *iptr = 7;
anatofuz
parents:
diff changeset
112 // CHECK: store i32 7,
anatofuz
parents:
diff changeset
113 // CHECK: br label %[[INNER_INC]]
anatofuz
parents:
diff changeset
114 // CHECK: [[INNER_INC]]
anatofuz
parents:
diff changeset
115 // CHECK: br label %[[INNER_COND]]
anatofuz
parents:
diff changeset
116 }
anatofuz
parents:
diff changeset
117 // CHECK: [[INNER_END]]
anatofuz
parents:
diff changeset
118 // CHECK: br label %[[OUTER_INC:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
119 // CHECK: [[OUTER_INC]]
anatofuz
parents:
diff changeset
120 // CHECK: br label %[[OUTER_COND]]
anatofuz
parents:
diff changeset
121 // CHECK: [[OUTER_END]]
anatofuz
parents:
diff changeset
122 // CHECK: ret
anatofuz
parents:
diff changeset
123 }
anatofuz
parents:
diff changeset
124
anatofuz
parents:
diff changeset
125 void pr8880_cg_5(int x, int *iptr) {
anatofuz
parents:
diff changeset
126 // CHECK-LABEL: define {{.*}}void @pr8880_cg_5(
anatofuz
parents:
diff changeset
127 int y = 5;
anatofuz
parents:
diff changeset
128 // CHECK: br label %[[OUTER_COND:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
129 // CHECK: [[OUTER_COND]]
anatofuz
parents:
diff changeset
130 while(--x) {
anatofuz
parents:
diff changeset
131 // CHECK: label %[[OUTER_BODY:[0-9A-Za-z$._]+]], label %[[OUTER_END:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
132 // CHECK: [[OUTER_BODY]]
anatofuz
parents:
diff changeset
133 // CHECK: br label %[[INNER_COND:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
134 while(({ break; --y; })) {
anatofuz
parents:
diff changeset
135 // CHECK: [[INNER_COND]]
anatofuz
parents:
diff changeset
136 // CHECK: br label %[[INNER_END:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
137 // CHECK: label %[[INNER_BODY:[0-9A-Za-z$._]+]], label %[[INNER_END:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
138 // CHECK: [[INNER_BODY]]
anatofuz
parents:
diff changeset
139 *iptr = 7;
anatofuz
parents:
diff changeset
140 // CHECK: store i32 7,
anatofuz
parents:
diff changeset
141 }
anatofuz
parents:
diff changeset
142 // CHECK: br label %[[INNER_COND]]
anatofuz
parents:
diff changeset
143 }
anatofuz
parents:
diff changeset
144 // CHECK: [[INNER_END]]
anatofuz
parents:
diff changeset
145 // CHECK: br label %[[OUTER_COND]]
anatofuz
parents:
diff changeset
146 // CHECK: [[OUTER_END]]
anatofuz
parents:
diff changeset
147 // CHECK: ret void
anatofuz
parents:
diff changeset
148 }
anatofuz
parents:
diff changeset
149
anatofuz
parents:
diff changeset
150 void pr8880_cg_6(int x, int *iptr) {
anatofuz
parents:
diff changeset
151 // CHECK-LABEL: define {{.*}}void @pr8880_cg_6(
anatofuz
parents:
diff changeset
152 int y = 5;
anatofuz
parents:
diff changeset
153 // CHECK: br label %[[OUTER_COND:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
154 // CHECK: [[OUTER_COND]]
anatofuz
parents:
diff changeset
155 while(--x) {
anatofuz
parents:
diff changeset
156 // CHECK: label %[[OUTER_BODY:[0-9A-Za-z$._]+]], label %[[OUTER_END:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
157 // CHECK: [[OUTER_BODY]]
anatofuz
parents:
diff changeset
158 // CHECK: br label %[[INNER_BODY:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
159 // CHECK: [[INNER_BODY]]
anatofuz
parents:
diff changeset
160 do {
anatofuz
parents:
diff changeset
161 // CHECK: store i32 7,
anatofuz
parents:
diff changeset
162 *iptr = 7;
anatofuz
parents:
diff changeset
163 // CHECK: br label %[[INNER_COND:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
164 } while(({ break; --y; }));
anatofuz
parents:
diff changeset
165 // CHECK: [[INNER_COND]]
anatofuz
parents:
diff changeset
166 // CHECK: br label %[[INNER_END:[0-9A-Za-z$._]+]]
anatofuz
parents:
diff changeset
167 // CHECK: label %[[INNER_BODY:[0-9A-Za-z$._]+]], label %[[INNER_END]]
anatofuz
parents:
diff changeset
168 }
anatofuz
parents:
diff changeset
169 // CHECK: [[INNER_END]]
anatofuz
parents:
diff changeset
170 // CHECK: br label %[[OUTER_COND]]
anatofuz
parents:
diff changeset
171 // CHECK: [[OUTER_END]]
anatofuz
parents:
diff changeset
172 // CHECK: ret void
anatofuz
parents:
diff changeset
173 }