summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/IR/AsmWriter.cpp4
-rw-r--r--llvm/test/Feature/undefined.ll13
2 files changed, 16 insertions, 1 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index acf0e4afef2..1f978d13604 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -2651,8 +2651,10 @@ void AssemblyWriter::printModule(const Module *M) {
printUseLists(nullptr);
// Output all of the functions.
- for (const Function &F : *M)
+ for (const Function &F : *M) {
+ Out << '\n';
printFunction(&F);
+ }
assert(UseListOrders.empty() && "All use-lists should have been consumed");
// Output all attribute groups.
diff --git a/llvm/test/Feature/undefined.ll b/llvm/test/Feature/undefined.ll
index e63ce41f681..e01ed4c0f9c 100644
--- a/llvm/test/Feature/undefined.ll
+++ b/llvm/test/Feature/undefined.ll
@@ -1,6 +1,7 @@
; RUN: llvm-as < %s | llvm-dis > %t1.ll
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
; RUN: diff %t1.ll %t2.ll
+; RUN: FileCheck %s < %t1.ll
@X = global i32 undef ; <i32*> [#uses=0]
@@ -15,3 +16,15 @@ define i32 @test2() {
ret i32 %X
}
+
+; Check that there is a newline between functions.
+
+; CHECK: @X = global
+; CHECK-EMPTY:
+; CHECK: declare i32 @atoi(i8*)
+; CHECK-EMPTY:
+; CHECK: define i32 @test() {
+; CHECK: {{^[}]}}
+; CHECK-EMPTY:
+; CHECK: define i32 @test2() {
+; CHECK: {{^[}]}}
OpenPOWER on IntegriCloud