From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/CodeGen/dostmt.c | 70 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 clang/test/CodeGen/dostmt.c (limited to 'clang/test/CodeGen/dostmt.c') diff --git a/clang/test/CodeGen/dostmt.c b/clang/test/CodeGen/dostmt.c new file mode 100644 index 0000000..1a2e02a --- /dev/null +++ b/clang/test/CodeGen/dostmt.c @@ -0,0 +1,70 @@ +// RUN: %clang_cc1 %s -emit-llvm -o - + +int bar(); +int test0() { + int i; + i = 1 + 2; + do { + i = bar(); + i = bar(); + } while(0); + return i; +} + + +int test1() { + int i; + i = 1 + 2; + do { + i = bar(); + if (i == 42) + break; + i = bar(); + } while(1); + return i; +} + + +int test2() { + int i; + i = 1 + 2; + do { + i = bar(); + if (i == 42) + continue; + i = bar(); + } while(1); + return i; +} + + +int test3() { + int i; + i = 1 + 2; + do { + i = bar(); + if (i == 42) + break; + } while(0); + return i; +} + + +int test4() { + int i; + i = 1 + 2; + do { + i = bar(); + if (i == 42) + continue; + } while(0); + return i; +} + +// rdar://6103124 +void test5() { + do { break; } while(0); +} + + + -- cgit v1.2.3