llvm-project/clang/test/CodeGen/dostmt.c

71 lines
720 B
C
Raw Normal View History

// RUN: clang %s -emit-llvm -o -
2007-10-10 04:37:41 +08:00
int bar();
int test0() {
2007-10-10 04:37:41 +08:00
int i;
i = 1 + 2;
do {
i = bar();
i = bar();
} while(0);
return i;
}
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;
}
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;
}
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;
}
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;
}
// rdar://6103124
void test5() {
do { break; } while(0);
}