From: Devang Patel Date: Tue, 9 Oct 2007 20:37:41 +0000 (+0000) Subject: new test X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a2c534223dc6b81685d1323fedca53c54918bb66;p=clang new test git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42810 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/dostmt.c b/test/CodeGen/dostmt.c new file mode 100644 index 0000000000..b721974dc5 --- /dev/null +++ b/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; +}