summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/Generic
diff options
context:
space:
mode:
authorPaul Robinson <paul.robinson@sony.com>2018-03-27 22:40:34 +0000
committerPaul Robinson <paul.robinson@sony.com>2018-03-27 22:40:34 +0000
commit07480bd17760c76fa6d51c4dfc3337247beda6de (patch)
tree90b9e07b451e8189cd79834b2f7e8cc89e54114e /llvm/test/CodeGen/Generic
parent2519ee70810c561ce40e5e4e57a9c083d30faf67 (diff)
downloadbcm5719-llvm-07480bd17760c76fa6d51c4dfc3337247beda6de.tar.gz
bcm5719-llvm-07480bd17760c76fa6d51c4dfc3337247beda6de.zip
Reapply "[DWARFv5] Emit file 0 to the line table."
DWARF v5 specifies that the root file (also given in the DW_AT_name attribute of the compilation unit DIE) should be emitted explicitly to the line table's list of files. This makes the line table more independent of the .debug_info section. Fixes the bug found by asan. Also XFAIL the new test for Darwin, which is stuck on DWARF v2, and fix up other tests so they stop failing on Windows. Last but not least, don't break "clang -g" of an assembler file that has .file directives in it. Differential Revision: https://reviews.llvm.org/D44054 llvm-svn: 328676
Diffstat (limited to 'llvm/test/CodeGen/Generic')
-rw-r--r--llvm/test/CodeGen/Generic/dwarf-md5.ll35
-rw-r--r--llvm/test/CodeGen/Generic/dwarf-source.ll39
2 files changed, 34 insertions, 40 deletions
diff --git a/llvm/test/CodeGen/Generic/dwarf-md5.ll b/llvm/test/CodeGen/Generic/dwarf-md5.ll
index b9977200de1..09b901efaf7 100644
--- a/llvm/test/CodeGen/Generic/dwarf-md5.ll
+++ b/llvm/test/CodeGen/Generic/dwarf-md5.ll
@@ -8,28 +8,25 @@
; RUN: %llc_dwarf -dwarf-version 4 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM
; RUN: %llc_dwarf -dwarf-version 5 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM
; RUN: %llc_dwarf -dwarf-version 4 -filetype=obj -o %t4.o %s
-; RUN: llvm-dwarfdump -debug-line %t4.o | FileCheck %s --check-prefix=OBJ-4
+; RUN: llvm-dwarfdump -debug-line %t4.o | FileCheck %s --check-prefix=OBJ
; RUN: %llc_dwarf -dwarf-version 5 -filetype=obj -o %t5.o %s
-; RUN: llvm-dwarfdump -debug-line %t5.o | FileCheck %s --check-prefix=OBJ-5
+; RUN: llvm-dwarfdump -debug-line %t5.o | FileCheck %s --check-prefixes=OBJ,OBJ-5
-; FIXME: Need to convey the MD5 for the primary source file.
-; ASM: .file 1 ".{{/|\\\\}}t1.h" md5 "11111111111111111111111111111111"
-; ASM: .file 2 ".{{/|\\\\}}t2.h" md5 "22222222222222222222222222222222"
-
-; OBJ-4: file_names[ 1]:
-; OBJ-4-NEXT: name: "t1.h"
-; OBJ-4-NEXT: dir_index: 1
-; OBJ-4: file_names[ 2]:
-; OBJ-4-NEXT: name: "t2.h"
-; OBJ-4-NEXT: dir_index: 1
+; ASM: .file 0 "[[COMPDIR:.*]]{{[/\\]}}t.c" md5 "00000000000000000000000000000000"
+; ASM: .file 1 "[[COMPDIR]]{{[/\\]}}t1.h" md5 "11111111111111111111111111111111"
+; ASM: .file 2 "[[COMPDIR]]{{[/\\]}}t2.h" md5 "22222222222222222222222222222222"
; OBJ-5: file_names[ 0]:
-; OBJ-5-NEXT: name: "t1.h"
-; OBJ-5-NEXT: dir_index: 1
+; OBJ-5-NEXT: name: "t.c"
+; OBJ-5-NEXT: dir_index: 0
+; OBJ-5-NEXT: md5_checksum: 00000000000000000000000000000000
+; OBJ: file_names[ 1]:
+; OBJ-NEXT: name: "t1.h"
+; OBJ-NEXT: dir_index: 0
; OBJ-5-NEXT: md5_checksum: 11111111111111111111111111111111
-; OBJ-5: file_names[ 1]:
-; OBJ-5-NEXT: name: "t2.h"
-; OBJ-5-NEXT: dir_index: 1
+; OBJ: file_names[ 2]:
+; OBJ-NEXT: name: "t2.h"
+; OBJ-NEXT: dir_index: 0
; OBJ-5-NEXT: md5_checksum: 22222222222222222222222222222222
; ModuleID = 't.c'
@@ -50,9 +47,9 @@ source_filename = "t.c"
!5 = !{!0, !6}
!6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
!7 = distinct !DIGlobalVariable(name: "t2", scope: !2, file: !8, line: 1, type: !9, isLocal: false, isDefinition: true)
-!8 = !DIFile(filename: "./t2.h", directory: "/home/probinson/projects/scratch", checksumkind: CSK_MD5, checksum: "22222222222222222222222222222222")
+!8 = !DIFile(filename: "t2.h", directory: "/home/probinson/projects/scratch", checksumkind: CSK_MD5, checksum: "22222222222222222222222222222222")
!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-!10 = !DIFile(filename: "./t1.h", directory: "/home/probinson/projects/scratch", checksumkind: CSK_MD5, checksum: "11111111111111111111111111111111")
+!10 = !DIFile(filename: "t1.h", directory: "/home/probinson/projects/scratch", checksumkind: CSK_MD5, checksum: "11111111111111111111111111111111")
!11 = !{i32 2, !"Dwarf Version", i32 4}
!12 = !{i32 2, !"Debug Info Version", i32 3}
!13 = !{i32 1, !"wchar_size", i32 4}
diff --git a/llvm/test/CodeGen/Generic/dwarf-source.ll b/llvm/test/CodeGen/Generic/dwarf-source.ll
index 9c34fc5285b..e59193d0d8a 100644
--- a/llvm/test/CodeGen/Generic/dwarf-source.ll
+++ b/llvm/test/CodeGen/Generic/dwarf-source.ll
@@ -8,30 +8,27 @@
; RUN: %llc_dwarf -dwarf-version 4 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM
; RUN: %llc_dwarf -dwarf-version 5 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM
; RUN: %llc_dwarf -dwarf-version 4 -filetype=obj -o %t4.o %s
-; RUN: llvm-dwarfdump -debug-line %t4.o | FileCheck %s --check-prefix=OBJ-4
+; RUN: llvm-dwarfdump -debug-line %t4.o | FileCheck %s --check-prefixes=OBJ,OBJ-4
; RUN: %llc_dwarf -dwarf-version 5 -filetype=obj -o %t5.o %s
-; RUN: llvm-dwarfdump -debug-line %t5.o | FileCheck %s --check-prefix=OBJ-5
+; RUN: llvm-dwarfdump -debug-line %t5.o | FileCheck %s --check-prefixes=OBJ,OBJ-5
-; FIXME: Need to convey the source for the primary source file.
-; ASM: .file 1 ".{{/|\\\\}}t1.h" source "11111111111111111111111111111111"
-; ASM: .file 2 ".{{/|\\\\}}t2.h" source "22222222222222222222222222222222"
-
-; OBJ-4: file_names[ 1]:
-; OBJ-4-NEXT: name: "t1.h"
-; OBJ-4-NEXT: dir_index: 1
-; OBJ-4-NOT: 11111111111111111111111111111111
-; OBJ-4: file_names[ 2]:
-; OBJ-4-NEXT: name: "t2.h"
-; OBJ-4-NEXT: dir_index: 1
-; OBJ-4-NOT: 22222222222222222222222222222222
+; ASM: .file 0 "[[COMPDIR:.*]]{{[/\\]}}t.c" source "00000000000000000000000000000000"
+; ASM: .file 1 "[[COMPDIR]]{{[/\\]}}t1.h" source "11111111111111111111111111111111"
+; ASM: .file 2 "[[COMPDIR]]{{[/\\]}}t2.h" source "22222222222222222222222222222222"
; OBJ-5: file_names[ 0]:
-; OBJ-5-NEXT: name: "t1.h"
-; OBJ-5-NEXT: dir_index: 1
+; OBJ-5-NEXT: name: "t.c"
+; OBJ-5-NEXT: dir_index: 0
+; OBJ-5-NEXT: source: "00000000000000000000000000000000"
+; OBJ: file_names[ 1]:
+; OBJ-NEXT: name: "t1.h"
+; OBJ-NEXT: dir_index: 0
+; OBJ-4-NOT: 11111111111111111111111111111111
; OBJ-5-NEXT: source: "11111111111111111111111111111111"
-; OBJ-5: file_names[ 1]:
-; OBJ-5-NEXT: name: "t2.h"
-; OBJ-5-NEXT: dir_index: 1
+; OBJ: file_names[ 2]:
+; OBJ-NEXT: name: "t2.h"
+; OBJ-NEXT: dir_index: 0
+; OBJ-4-NOT: 22222222222222222222222222222222
; OBJ-5-NEXT: source: "22222222222222222222222222222222"
; ModuleID = 't.c'
@@ -52,9 +49,9 @@ source_filename = "t.c"
!5 = !{!0, !6}
!6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
!7 = distinct !DIGlobalVariable(name: "t2", scope: !2, file: !8, line: 1, type: !9, isLocal: false, isDefinition: true)
-!8 = !DIFile(filename: "./t2.h", directory: "/test", source: "22222222222222222222222222222222")
+!8 = !DIFile(filename: "t2.h", directory: "/test", source: "22222222222222222222222222222222")
!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-!10 = !DIFile(filename: "./t1.h", directory: "/test", source: "11111111111111111111111111111111")
+!10 = !DIFile(filename: "t1.h", directory: "/test", source: "11111111111111111111111111111111")
!11 = !{i32 2, !"Dwarf Version", i32 4}
!12 = !{i32 2, !"Debug Info Version", i32 3}
!13 = !{i32 1, !"wchar_size", i32 4}
OpenPOWER on IntegriCloud