]> granicus.if.org Git - clang/commitdiff
new test
authorDevang Patel <dpatel@apple.com>
Tue, 9 Oct 2007 20:37:41 +0000 (20:37 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 9 Oct 2007 20:37:41 +0000 (20:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42810 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/dostmt.c [new file with mode: 0644]

diff --git a/test/CodeGen/dostmt.c b/test/CodeGen/dostmt.c
new file mode 100644 (file)
index 0000000..b721974
--- /dev/null
@@ -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;
+}