summaryrefslogtreecommitdiff
path: root/test/DebugInfo
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-07-01 21:45:25 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-07-01 21:45:25 +0000
commita35ae962918258207f9092ccbdf4fffa1f2c70f1 (patch)
tree714e3c5d5f29eb0dd4fcfe1c4561cef6242ec35b /test/DebugInfo
parent1307d8300f6fe97059998480c42b44faefbc9b99 (diff)
downloadllvm-a35ae962918258207f9092ccbdf4fffa1f2c70f1.tar.gz
llvm-a35ae962918258207f9092ccbdf4fffa1f2c70f1.tar.bz2
llvm-a35ae962918258207f9092ccbdf4fffa1f2c70f1.tar.xz
PR16493: DebugInfo with TLS on PPC crashing due to invalid relocation
Restrict the current TLS support to X86 ELF for now. Test that we don't produce it on PPC & we can flesh that test case out with the right thing once someone implements it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185389 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/DebugInfo')
-rw-r--r--test/DebugInfo/PowerPC/lit.local.cfg5
-rw-r--r--test/DebugInfo/PowerPC/tls.ll22
-rw-r--r--test/DebugInfo/X86/tls.ll4
3 files changed, 29 insertions, 2 deletions
diff --git a/test/DebugInfo/PowerPC/lit.local.cfg b/test/DebugInfo/PowerPC/lit.local.cfg
new file mode 100644
index 0000000000..112a1c3456
--- /dev/null
+++ b/test/DebugInfo/PowerPC/lit.local.cfg
@@ -0,0 +1,5 @@
+config.suffixes = ['.ll', '.s']
+
+targets = set(config.root.targets_to_build.split())
+if not 'PowerPC' in targets:
+ config.unsupported = True
diff --git a/test/DebugInfo/PowerPC/tls.ll b/test/DebugInfo/PowerPC/tls.ll
new file mode 100644
index 0000000000..3e53896de9
--- /dev/null
+++ b/test/DebugInfo/PowerPC/tls.ll
@@ -0,0 +1,22 @@
+; RUN: llc -mtriple=powerpc-unknown-unknown -O0 -filetype=asm < %s | FileCheck %s
+
+; FIXME: add relocation and DWARF expression support to llvm-dwarfdump & use
+; that here instead of raw assembly printing
+
+; CHECK: debug_info
+; CHECK-NOT: tls@DTPOFF
+
+@tls = thread_local global i32 7, align 4
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!7}
+
+!0 = metadata !{i32 786449, metadata !1, i32 4, metadata !"clang version 3.4 ", i1 false, metadata !"", i32 0, metadata !2, metadata !2, metadata !2, metadata !3, metadata !2, metadata !""} ; [ DW_TAG_compile_unit ] [/tmp/tls.cpp] [DW_LANG_C_plus_plus]
+!1 = metadata !{metadata !"tls.cpp", metadata !"/tmp"}
+!2 = metadata !{i32 0}
+!3 = metadata !{metadata !4}
+!4 = metadata !{i32 786484, i32 0, null, metadata !"tls", metadata !"tls", metadata !"", metadata !5, i32 1, metadata !6, i32 0, i32 1, i32* @tls, null} ; [ DW_TAG_variable ] [tls] [line 1] [def]
+!5 = metadata !{i32 786473, metadata !1} ; [ DW_TAG_file_type ] [/tmp/tls.cpp]
+!6 = metadata !{i32 786468, null, null, metadata !"int", i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
+!7 = metadata !{i32 2, metadata !"Dwarf Version", i32 3}
+
diff --git a/test/DebugInfo/X86/tls.ll b/test/DebugInfo/X86/tls.ll
index 2ed673af84..e2a9af962c 100644
--- a/test/DebugInfo/X86/tls.ll
+++ b/test/DebugInfo/X86/tls.ll
@@ -1,5 +1,5 @@
-; RUN: llc -mtriple=x86_64-unknown-unknown -O0 -filetype=asm < %s | FileCheck %s
-; RUN: llc -mtriple=i386-unknown-unknown -O0 -filetype=asm < %s | FileCheck --check-prefix=CHECK-32 %s
+; RUN: llc -mtriple=x86_64-linux -O0 -filetype=asm < %s | FileCheck %s
+; RUN: llc -mtriple=i386-linux -O0 -filetype=asm < %s | FileCheck --check-prefix=CHECK-32 %s
; FIXME: add relocation and DWARF expression support to llvm-dwarfdump & use
; that here instead of raw assembly printing