2012-10-27 07:23:35 +08:00
|
|
|
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
|
2007-10-10 04:37:41 +08:00
|
|
|
|
|
|
|
int bar();
|
2008-07-26 07:40:10 +08:00
|
|
|
int test0() {
|
2007-10-10 04:37:41 +08:00
|
|
|
int i;
|
|
|
|
i = 1 + 2;
|
|
|
|
do {
|
|
|
|
i = bar();
|
|
|
|
i = bar();
|
|
|
|
} while(0);
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-07-26 07:40:10 +08:00
|
|
|
int test1() {
|
2007-10-10 04:37:41 +08:00
|
|
|
int i;
|
|
|
|
i = 1 + 2;
|
|
|
|
do {
|
|
|
|
i = bar();
|
|
|
|
if (i == 42)
|
|
|
|
break;
|
|
|
|
i = bar();
|
|
|
|
} while(1);
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-07-26 07:40:10 +08:00
|
|
|
int test2() {
|
2007-10-10 04:37:41 +08:00
|
|
|
int i;
|
|
|
|
i = 1 + 2;
|
|
|
|
do {
|
|
|
|
i = bar();
|
|
|
|
if (i == 42)
|
|
|
|
continue;
|
|
|
|
i = bar();
|
|
|
|
} while(1);
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-07-26 07:40:10 +08:00
|
|
|
int test3() {
|
2007-10-10 04:37:41 +08:00
|
|
|
int i;
|
|
|
|
i = 1 + 2;
|
|
|
|
do {
|
|
|
|
i = bar();
|
|
|
|
if (i == 42)
|
|
|
|
break;
|
|
|
|
} while(0);
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-07-26 07:40:10 +08:00
|
|
|
int test4() {
|
2007-10-10 04:37:41 +08:00
|
|
|
int i;
|
|
|
|
i = 1 + 2;
|
|
|
|
do {
|
|
|
|
i = bar();
|
|
|
|
if (i == 42)
|
|
|
|
continue;
|
|
|
|
} while(0);
|
|
|
|
return i;
|
|
|
|
}
|
2008-07-26 07:40:10 +08:00
|
|
|
|
|
|
|
// rdar://6103124
|
|
|
|
void test5() {
|
|
|
|
do { break; } while(0);
|
|
|
|
}
|
|
|
|
|
2012-10-27 07:23:35 +08:00
|
|
|
// PR14191
|
|
|
|
void test6f(void);
|
|
|
|
void test6() {
|
|
|
|
do {
|
|
|
|
} while (test6f(), 0);
|
2012-10-27 07:25:42 +08:00
|
|
|
// CHECK: call void @test6f()
|
2012-10-27 07:23:35 +08:00
|
|
|
}
|
2008-07-26 07:40:10 +08:00
|
|
|
|