blob: 3557b48053ffe85d9d4de14354f9a8f9fc4014d1 [file] [log] [blame]
Daniel Dunbar55a759b2009-08-23 19:28:59 +00001// FIXME: We forcibly strip the names so that the test doesn't vary between
2// builds with and without asserts. We need a better solution for this.
3
Daniel Dunbara5728872009-12-15 20:14:24 +00004// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -emit-llvm-bc -o - %s | opt -strip | llvm-dis > %t
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00005// RUN: grep '%6 = call i32 (...)\* @rhs()' %t | count 1
6// RUN: grep '%7 = getelementptr inbounds %0\* %1, i32 0, i32 1' %t | count 1
7// RUN: grep '%8 = load %0\*\* %7' %t | count 1
8// RUN: grep '%10 = call i32 (...)\* @rhs()' %t | count 1
9// RUN: grep '%11 = getelementptr inbounds %0\* %1, i32 0, i32 1' %t | count 1
Anders Carlsson36043862009-09-10 01:32:12 +000010// RUN: grep '%12 = load %0\*\* %11' %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}