blob: 4fb3dcdee9bc269f8d69f64b6e8eef038316fbb1 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc %s -emit-llvm -o -
Devang Patela2c53422007-10-09 20:37:41 +00002
3int bar();
Chris Lattner1e9660e2008-07-25 23:40:10 +00004int test0() {
Devang Patela2c53422007-10-09 20:37:41 +00005 int i;
6 i = 1 + 2;
7 do {
8 i = bar();
9 i = bar();
10 } while(0);
11 return i;
12}
13
14
Chris Lattner1e9660e2008-07-25 23:40:10 +000015int test1() {
Devang Patela2c53422007-10-09 20:37:41 +000016 int i;
17 i = 1 + 2;
18 do {
19 i = bar();
20 if (i == 42)
21 break;
22 i = bar();
23 } while(1);
24 return i;
25}
26
27
Chris Lattner1e9660e2008-07-25 23:40:10 +000028int test2() {
Devang Patela2c53422007-10-09 20:37:41 +000029 int i;
30 i = 1 + 2;
31 do {
32 i = bar();
33 if (i == 42)
34 continue;
35 i = bar();
36 } while(1);
37 return i;
38}
39
40
Chris Lattner1e9660e2008-07-25 23:40:10 +000041int test3() {
Devang Patela2c53422007-10-09 20:37:41 +000042 int i;
43 i = 1 + 2;
44 do {
45 i = bar();
46 if (i == 42)
47 break;
48 } while(0);
49 return i;
50}
51
52
Chris Lattner1e9660e2008-07-25 23:40:10 +000053int test4() {
Devang Patela2c53422007-10-09 20:37:41 +000054 int i;
55 i = 1 + 2;
56 do {
57 i = bar();
58 if (i == 42)
59 continue;
60 } while(0);
61 return i;
62}
Chris Lattner1e9660e2008-07-25 23:40:10 +000063
64// rdar://6103124
65void test5() {
66 do { break; } while(0);
67}
68
69
70