diff options
author | Devang Patel <dpatel@apple.com> | 2007-10-09 20:37:41 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-10-09 20:37:41 +0000 |
commit | a2c534223dc6b81685d1323fedca53c54918bb66 (patch) | |
tree | 271e0cd04594f6a9491c4649dcc7c57457be143a /test/CodeGen/dostmt.c | |
parent | 90ae68aae98f12fe1950c63e2f6bd0fabce6cb1e (diff) |
new test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42810 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/dostmt.c')
-rw-r--r-- | test/CodeGen/dostmt.c | 62 |
1 files changed, 62 insertions, 0 deletions
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; +} |