Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGen / 2009-01-05-BlockInlining.c
blob8c1ddac31af772059e4667a2e3cafaf8a969ffdc
1 // RUN: %clang_cc1 %s -triple x86_64-linux -emit-llvm -fblocks -o - | FileCheck %s
3 // These will be inlined by the optimizers provided the block descriptors
4 // and block literals are internal constants.
5 // CHECK: @__block_descriptor_tmp = internal constant
6 // CHECK: @__block_literal_global = internal constant
7 // CHECK: @__block_descriptor_tmp.2 = internal constant
8 // CHECK: @__block_literal_global.3 = internal constant
9 static int fun(int x) {
10 return x+1;
13 static int block(int x) {
14 return (^(int x){return x+1;})(x);
17 extern int printf(const char *, ...);
18 static void print(int result) {
19 printf("%d\n", result);
22 int main (int argc, const char * argv[]) {
23 int x = argc-1;
24 print(fun(x));
25 print(block(x));
26 int (^block_inline)(int) = ^(int x){return x+1;};
27 print(block_inline(x));
28 return 0;