summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/dostmt.c
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-10-09 20:37:41 +0000
committerDevang Patel <dpatel@apple.com>2007-10-09 20:37:41 +0000
commitf8a76755df0cfa1cbb0adb7a5a53a287a37f0582 (patch)
treec9d3bf744fd8030a7409d6628a815cf06bd15133 /clang/test/CodeGen/dostmt.c
parent87547e6c15ebdd35f930e4879911021ec9e5af47 (diff)
downloadbcm5719-llvm-f8a76755df0cfa1cbb0adb7a5a53a287a37f0582.tar.gz
bcm5719-llvm-f8a76755df0cfa1cbb0adb7a5a53a287a37f0582.zip
new test
llvm-svn: 42810
Diffstat (limited to 'clang/test/CodeGen/dostmt.c')
-rw-r--r--clang/test/CodeGen/dostmt.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/clang/test/CodeGen/dostmt.c b/clang/test/CodeGen/dostmt.c
new file mode 100644
index 00000000000..b721974dc57
--- /dev/null
+++ b/clang/test/CodeGen/dostmt.c
@@ -0,0 +1,62 @@
+// RUN: clang %s -emit-llvm
+
+int bar();
+int foo() {
+ int i;
+ i = 1 + 2;
+ do {
+ i = bar();
+ i = bar();
+ } while(0);
+ return i;
+}
+
+
+int foo1() {
+ int i;
+ i = 1 + 2;
+ do {
+ i = bar();
+ if (i == 42)
+ break;
+ i = bar();
+ } while(1);
+ return i;
+}
+
+
+int foo2() {
+ int i;
+ i = 1 + 2;
+ do {
+ i = bar();
+ if (i == 42)
+ continue;
+ i = bar();
+ } while(1);
+ return i;
+}
+
+
+int foo3() {
+ int i;
+ i = 1 + 2;
+ do {
+ i = bar();
+ if (i == 42)
+ break;
+ } while(0);
+ return i;
+}
+
+
+int foo4() {
+ int i;
+ i = 1 + 2;
+ do {
+ i = bar();
+ if (i == 42)
+ continue;
+ } while(0);
+ return i;
+}
OpenPOWER on IntegriCloud