diff options
author | Mike Stump <mrs@apple.com> | 2009-05-21 21:05:15 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-05-21 21:05:15 +0000 |
commit | aed08f9929e20265acb91d14d5b5db87b86c8bf1 (patch) | |
tree | 7cd20e2e4a7733763965d6143b67671408ea78db /clang/test/CodeGen/blocks-seq.c | |
parent | 8c46fec43d1fe7acf9f21d3bc9e2c4c01ff34085 (diff) | |
download | bcm5719-llvm-aed08f9929e20265acb91d14d5b5db87b86c8bf1.tar.gz bcm5719-llvm-aed08f9929e20265acb91d14d5b5db87b86c8bf1.zip |
Fixup blocks codegen for { __block i; i = rhs(); }, we want the rhs
evaluated first. This can also improve codegen just a bit as we might
have another register to play with for the evaluation of the rhs.
llvm-svn: 72226
Diffstat (limited to 'clang/test/CodeGen/blocks-seq.c')
-rw-r--r-- | clang/test/CodeGen/blocks-seq.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/CodeGen/blocks-seq.c b/clang/test/CodeGen/blocks-seq.c new file mode 100644 index 00000000000..eb4990a3df6 --- /dev/null +++ b/clang/test/CodeGen/blocks-seq.c @@ -0,0 +1,13 @@ +// RUN: clang-cc -fblocks -triple x86_64-apple-darwin10 -emit-llvm -o %t %s && +// RUN: grep '%call = call i32 (...)\* @rhs()' %t | count 1 && +// If this fails, see about sliding %4 and %5... +// RUN: grep '%forwarding1 = getelementptr %0\* %i, i32 0, i32 1' %t | count 1 && +// RUN: grep '%4 = bitcast i8\*\* %forwarding1 to %0\*\*' %t | count 1 && +// RUN: grep '%5 = load %0\*\* %4' %t | count 1 + +int rhs(); + +void foo() { + __block int i; + i = rhs(); +} |