diff options
Diffstat (limited to 'clang/test/CodeGen/blocks-1.c')
-rw-r--r-- | clang/test/CodeGen/blocks-1.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/CodeGen/blocks-1.c b/clang/test/CodeGen/blocks-1.c new file mode 100644 index 00000000000..09f009c8a77 --- /dev/null +++ b/clang/test/CodeGen/blocks-1.c @@ -0,0 +1,14 @@ +// RUN: clang %s -emit-llvm -o %t -fblocks -f__block +#include <stdio.h> + +int main() { + __block int a; + int b=2; + a=1; + printf("a is %d, b is %d\n", a, b); + ^{ a = 10; printf("a is %d, b is %d\n", a, b); }(); + printf("a is %d, b is %d\n", a, b); + a = 1; + printf("a is %d, b is %d\n", a, b); + return 0; +} |