summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/Generic
diff options
context:
space:
mode:
authorPaul Robinson <paul.robinson@sony.com>2018-03-29 17:16:41 +0000
committerPaul Robinson <paul.robinson@sony.com>2018-03-29 17:16:41 +0000
commitb271f31d8d31ad689958fb8ff75110c2db5515df (patch)
tree9fc7456a6408dc5f91f66d7975f02bfc378de9d6 /llvm/test/CodeGen/Generic
parent1b20416bfa4ed906d5b5f289aa8a4430b9620132 (diff)
downloadbcm5719-llvm-b271f31d8d31ad689958fb8ff75110c2db5515df.tar.gz
bcm5719-llvm-b271f31d8d31ad689958fb8ff75110c2db5515df.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. We emit the new syntax only for DWARF v5 and later. 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: 328805
Diffstat (limited to 'llvm/test/CodeGen/Generic')
-rw-r--r--llvm/test/CodeGen/Generic/dwarf-md5.ll46
-rw-r--r--llvm/test/CodeGen/Generic/dwarf-source.ll41
2 files changed, 43 insertions, 44 deletions
diff --git a/llvm/test/CodeGen/Generic/dwarf-md5.ll b/llvm/test/CodeGen/Generic/dwarf-md5.ll
index b9977200de1..0f23b90cc85 100644
--- a/llvm/test/CodeGen/Generic/dwarf-md5.ll
+++ b/llvm/test/CodeGen/Generic/dwarf-md5.ll
@@ -5,31 +5,33 @@
; XFAIL: darwin
; REQUIRES: object-emission
-; 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=asm -o - %s | FileCheck %s --check-prefixes=ASM,ASM-4
+; RUN: %llc_dwarf -dwarf-version 5 -filetype=asm -o - %s | FileCheck %s --check-prefixes=ASM,ASM-5
; 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-4-NOT: .file 0
+; ASM-5: .file 0 "/scratch{{[/\\]}}t.c" md5 "00000000000000000000000000000000"
+; ASM: .file 1 "/scratch{{[/\\]}}t1.h"
+; ASM-4-NOT: md5
+; ASM-5-SAME: md5 "11111111111111111111111111111111"
+; ASM: .file 2 "/scratch{{[/\\]}}t2.h"
+; ASM-4-NOT: md5
+; ASM-5-SAME: 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'
@@ -45,14 +47,14 @@ source_filename = "t.c"
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(name: "t1", scope: !2, file: !10, line: 1, type: !9, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 7.0.0 (trunk 322159)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
-!3 = !DIFile(filename: "t.c", directory: "/home/probinson/projects/scratch", checksumkind: CSK_MD5, checksum: "00000000000000000000000000000000")
+!3 = !DIFile(filename: "t.c", directory: "/scratch", checksumkind: CSK_MD5, checksum: "00000000000000000000000000000000")
!4 = !{}
!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: "/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: "/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..3f772d32ad1 100644
--- a/llvm/test/CodeGen/Generic/dwarf-source.ll
+++ b/llvm/test/CodeGen/Generic/dwarf-source.ll
@@ -6,32 +6,29 @@
; REQUIRES: object-emission
; 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 5 -filetype=asm -o - %s | FileCheck %s --check-prefixes=ASM,ASM-5
; 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-5: .file 0 "/test{{[/\\]}}t.c" source "00000000000000000000000000000000"
+; ASM: .file 1 "/test{{[/\\]}}t1.h" source "11111111111111111111111111111111"
+; ASM: .file 2 "/test{{[/\\]}}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