summaryrefslogtreecommitdiff
path: root/test/CodeGen
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-03-05 20:09:15 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-03-05 20:09:15 +0000
commitfc5436c95132cbbf3c2fc950d3c5906cc8ed62dd (patch)
tree9555e07e32414c6e43d3213e2256b1c700a1a441 /test/CodeGen
parent82d372e12bc20de0a37c23a9a1f288f4fda0dae2 (diff)
downloadllvm-fc5436c95132cbbf3c2fc950d3c5906cc8ed62dd.tar.gz
llvm-fc5436c95132cbbf3c2fc950d3c5906cc8ed62dd.tar.bz2
llvm-fc5436c95132cbbf3c2fc950d3c5906cc8ed62dd.tar.xz
Always print the implicit .text at the start of an asm file.
Before llvm-mc would print it, but llc was assuming that it would produce another section changing directive before one was needed. That assumption is false with inline asm. Fixes PR19049. Another option would be to always create the section, but in the asm printer avoid printing sections changes during initialization. That would work, but * We do use the fact that llvm-mc prints it in testing. The tests can be changed if needed. * A quick poll on IRC suggest that most developers prefer the implicit .text to be printed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203001 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/X86/GC/ocaml-gc.ll6
-rw-r--r--test/CodeGen/X86/pr19049.ll7
2 files changed, 11 insertions, 2 deletions
diff --git a/test/CodeGen/X86/GC/ocaml-gc.ll b/test/CodeGen/X86/GC/ocaml-gc.ll
index 6d5f8aebe1..37ddaf90bf 100644
--- a/test/CodeGen/X86/GC/ocaml-gc.ll
+++ b/test/CodeGen/X86/GC/ocaml-gc.ll
@@ -1,8 +1,10 @@
; RUN: llc < %s -mtriple=x86_64-linux-gnu | FileCheck %s
-define i32 @main(i32 %x) nounwind gc "ocaml" {
; CHECK: .text
-; CHECK-NEXT: .globl "caml<stdin>__code_begin"
+; CHECK-NEXT: .file "<stdin>"
+
+define i32 @main(i32 %x) nounwind gc "ocaml" {
+; CHECK: .globl "caml<stdin>__code_begin"
; CHECK-NEXT: "caml<stdin>__code_begin":
; CHECK-NEXT: .data
; CHECK-NEXT: .globl "caml<stdin>__data_begin"
diff --git a/test/CodeGen/X86/pr19049.ll b/test/CodeGen/X86/pr19049.ll
new file mode 100644
index 0000000000..027c9815e0
--- /dev/null
+++ b/test/CodeGen/X86/pr19049.ll
@@ -0,0 +1,7 @@
+; RUN: llc -mtriple x86_64-pc-linux %s -o - | FileCheck %s
+
+module asm ".pushsection foo"
+module asm ".popsection"
+
+; CHECK: .section foo,"",@progbits
+; CHECK: .text