Skip to content

Commit 84434a6

Browse files
committed
testcase for bill's patch.
llvm-svn: 61751
1 parent 1654ef0 commit 84434a6

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// RUN: %llvmgcc %s -S -emit-llvm -O2 -o - | grep {call i32 .*printf.*argc} | count 3
2+
// rdar://5865221
3+
4+
// All of these should be inlined equivalently into a single printf call.
5+
6+
static int fun(int x) {
7+
return x+1;
8+
}
9+
10+
static int block(int x) {
11+
return (^(int x){return x+1;})(x);
12+
}
13+
14+
static void print(int result) {
15+
printf("%d\n", result);
16+
}
17+
18+
int main (int argc, const char * argv[]) {
19+
int x = argc-1;
20+
print(fun(x));
21+
print(block(x));
22+
int (^block_inline)(int) = ^(int x){return x+1;};
23+
print(block_inline(x));
24+
return 0;
25+
}
26+

0 commit comments

Comments
 (0)