[llvm-commits] [llvm] r61751 - /llvm/trunk/test/FrontendC/2009-01-05-BlockInlining.c

Chris Lattner sabre at nondot.org
Mon Jan 5 13:07:34 PST 2009


Author: lattner
Date: Mon Jan  5 15:07:34 2009
New Revision: 61751

URL: http://llvm.org/viewvc/llvm-project?rev=61751&view=rev
Log:
testcase for bill's patch.


Added:
    llvm/trunk/test/FrontendC/2009-01-05-BlockInlining.c

Added: llvm/trunk/test/FrontendC/2009-01-05-BlockInlining.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC/2009-01-05-BlockInlining.c?rev=61751&view=auto

==============================================================================
--- llvm/trunk/test/FrontendC/2009-01-05-BlockInlining.c (added)
+++ llvm/trunk/test/FrontendC/2009-01-05-BlockInlining.c Mon Jan  5 15:07:34 2009
@@ -0,0 +1,26 @@
+// RUN: %llvmgcc %s -S -emit-llvm -O2 -o - | grep {call i32 .*printf.*argc} | count 3
+// rdar://5865221
+
+// All of these should be inlined equivalently into a single printf call.
+
+static int fun(int x) {
+	return x+1;
+}
+
+static int block(int x) {
+	return (^(int x){return x+1;})(x);
+}
+
+static void print(int result) {
+    printf("%d\n", result);
+}
+
+int main (int argc, const char * argv[]) {
+    int	x = argc-1;
+    print(fun(x));
+    print(block(x));
+    int	(^block_inline)(int) = ^(int x){return x+1;};
+    print(block_inline(x));
+    return 0;
+}
+





More information about the llvm-commits mailing list