blob: f637fbc0782eacaf01f5f0637860c28d01d9eb09 [file] [log] [blame]
Mike Stump99459b62009-05-21 21:05:15 +00001// RUN: clang-cc -fblocks -triple x86_64-apple-darwin10 -emit-llvm -o %t %s &&
2// RUN: grep '%call = call i32 (...)\* @rhs()' %t | count 1 &&
Mike Stumpcc0442f2009-05-22 19:07:20 +00003// If this fails, see about sliding %4, %5, %6 and %7...
Mike Stump99459b62009-05-21 21:05:15 +00004// RUN: grep '%forwarding1 = getelementptr %0\* %i, i32 0, i32 1' %t | count 1 &&
5// RUN: grep '%4 = bitcast i8\*\* %forwarding1 to %0\*\*' %t | count 1 &&
Mike Stumpcc0442f2009-05-22 19:07:20 +00006// RUN: grep '%5 = load %0\*\* %4' %t | count 1 &&
7// RUN: grep '%call2 = call i32 (...)\* @rhs()' %t | count 1 &&
8// RUN: grep '%forwarding3 = getelementptr %0\* %i, i32 0, i32 1' %t | count 1 &&
9// RUN: grep '%6 = bitcast i8\*\* %forwarding3 to %0\*\*' %t | count 1 &&
10// RUN: grep '%7 = load %0\*\* %6' %t | count 1
Mike Stump99459b62009-05-21 21:05:15 +000011
12int rhs();
13
14void foo() {
15 __block int i;
16 i = rhs();
Mike Stumpcc0442f2009-05-22 19:07:20 +000017 i += rhs();
Mike Stump99459b62009-05-21 21:05:15 +000018}