summaryrefslogtreecommitdiff
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 0000000..8b8282f
--- /dev/null
+++ b/clang/test/CodeGen/PR3589-freestanding-libcalls.c
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - | grep 'declare i32 @printf' | count 1
+// RUN: %clang_cc1 -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 1
+// RUN: %clang_cc1 -ffreestanding -O2 -emit-llvm %s -o - | grep 'declare i32 @puts' | count 0
+
+int printf(const char *, ...);
+
+void f0() {
+ printf("hello\n");
+}