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
|
|
|
|
2022-02-16 05:06:01 +08:00
|
|
|
int bar(void);
|
|
|
|
int test0(void) {
|
2007-10-10 04:37:41 +08:00
|
|
|
int i;
|
|
|
|
i = 1 + 2;
|
|
|
|
do {
|
|
|
|
i = bar();
|
|
|
|
i = bar();
|
|
|
|
} while(0);
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-02-16 05:06:01 +08:00
|
|
|
int test1(void) {
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-02-16 05:06:01 +08:00
|
|
|
int test2(void) {
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-02-16 05:06:01 +08:00
|
|
|
int test3(void) {
|
2007-10-10 04:37:41 +08:00
|
|
|
int i;
|
|
|
|
i = 1 + 2;
|
|
|
|
do {
|
|
|
|
i = bar();
|
|
|
|
if (i == 42)
|
|
|
|
break;
|
|
|
|
} while(0);
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-02-16 05:06:01 +08:00
|
|
|
int test4(void) {
|
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
|
2022-02-16 05:06:01 +08:00
|
|
|
void test5(void) {
|
2008-07-26 07:40:10 +08:00
|
|
|
do { break; } while(0);
|
|
|
|
}
|
|
|
|
|
2012-10-27 07:23:35 +08:00
|
|
|
// PR14191
|
|
|
|
void test6f(void);
|
2022-02-16 05:06:01 +08:00
|
|
|
void test6(void) {
|
2012-10-27 07:23:35 +08:00
|
|
|
do {
|
|
|
|
} while (test6f(), 0);
|
2015-06-30 01:29:50 +08:00
|
|
|
// CHECK: call {{.*}}void @test6f()
|
2012-10-27 07:23:35 +08:00
|
|
|
}
|
2008-07-26 07:40:10 +08:00
|
|
|
|