PPC::B and PPC::BCC's target operand may be an immediate.
[llvm/msp430.git] / test / FrontendC / 2009-01-05-BlockInlining.c
blob9692d8f688ab625dfe0e0c08a1e81288073dc784
1 // RUN: %llvmgcc %s -S -emit-llvm -O2 -o %t.s
2 // RUN: grep {call i32 .*printf.*argc} %t.s | count 3
3 // RUN: not grep __block_holder_tmp %t.s
4 // rdar://5865221
6 // All of these should be inlined equivalently into a single printf call.
8 static int fun(int x) {
9 return x+1;
12 static int block(int x) {
13 return (^(int x){return x+1;})(x);
16 static void print(int result) {
17 printf("%d\n", result);
20 int main (int argc, const char * argv[]) {
21 int x = argc-1;
22 print(fun(x));
23 print(block(x));
24 int (^block_inline)(int) = ^(int x){return x+1;};
25 print(block_inline(x));
26 return 0;