We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1654ef0 commit 84434a6Copy full SHA for 84434a6
llvm/test/FrontendC/2009-01-05-BlockInlining.c
@@ -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