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/blocks-seq.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 clang/test/CodeGen/blocks-seq.c (limited to 'clang/test/CodeGen/blocks-seq.c') diff --git a/clang/test/CodeGen/blocks-seq.c b/clang/test/CodeGen/blocks-seq.c new file mode 100644 index 0000000..3557b48 --- /dev/null +++ b/clang/test/CodeGen/blocks-seq.c @@ -0,0 +1,18 @@ +// FIXME: We forcibly strip the names so that the test doesn't vary between +// builds with and without asserts. We need a better solution for this. + +// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -emit-llvm-bc -o - %s | opt -strip | llvm-dis > %t +// RUN: grep '%6 = call i32 (...)\* @rhs()' %t | count 1 +// RUN: grep '%7 = getelementptr inbounds %0\* %1, i32 0, i32 1' %t | count 1 +// RUN: grep '%8 = load %0\*\* %7' %t | count 1 +// RUN: grep '%10 = call i32 (...)\* @rhs()' %t | count 1 +// RUN: grep '%11 = getelementptr inbounds %0\* %1, i32 0, i32 1' %t | count 1 +// RUN: grep '%12 = load %0\*\* %11' %t | count 1 + +int rhs(); + +void foo() { + __block int i; + i = rhs(); + i += rhs(); +} -- cgit v1.2.3