summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/PR3589-freestanding-libcalls.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGen/PR3589-freestanding-libcalls.c')
-rw-r--r--clang/test/CodeGen/PR3589-freestanding-libcalls.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGen/PR3589-freestanding-libcalls.c b/clang/test/CodeGen/PR3589-freestanding-libcalls.c
new file mode 100644
index 00000000000..61852e3c49b
--- /dev/null
+++ b/clang/test/CodeGen/PR3589-freestanding-libcalls.c
@@ -0,0 +1,9 @@
+// RUN: clang -emit-llvm %s -o - | grep 'declare i32 @printf' | count 1 &&
+// RUN: clang -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 1 &&
+// RUN: clang -ffreestanding -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 0
+
+#include <stdio.h>
+
+void f0() {
+ printf("hello\n");
+}
OpenPOWER on IntegriCloud