[llvm] r325973 - [DebugInfo] Add remaining files to r325970

Scott Linder via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 23 15:13:18 PST 2018


Author: scott.linder
Date: Fri Feb 23 15:13:18 2018
New Revision: 325973

URL: http://llvm.org/viewvc/llvm-project?rev=325973&view=rev
Log:
[DebugInfo] Add remaining files to r325970

Add files which I missed in the original check-in

Added:
    llvm/trunk/test/Bitcode/metadata-source.ll
    llvm/trunk/test/Bitcode/metadata-source.ll.bc   (with props)
    llvm/trunk/test/CodeGen/Generic/dwarf-source.ll
    llvm/trunk/test/Linker/Inputs/metadata-source-a.ll
    llvm/trunk/test/Linker/Inputs/metadata-source-b.ll
    llvm/trunk/test/Linker/metadata-source.ll
    llvm/trunk/test/MC/AsmParser/debug-empty-source.s
    llvm/trunk/test/MC/AsmParser/debug-no-source.s
    llvm/trunk/test/MC/ELF/debug-file-options.s
    llvm/trunk/test/MC/ELF/debug-source.s
    llvm/trunk/test/tools/llvm-objdump/Inputs/embedded-source   (with props)
    llvm/trunk/test/tools/llvm-objdump/embedded-source.test

Added: llvm/trunk/test/Bitcode/metadata-source.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/metadata-source.ll?rev=325973&view=auto
==============================================================================
--- llvm/trunk/test/Bitcode/metadata-source.ll (added)
+++ llvm/trunk/test/Bitcode/metadata-source.ll Fri Feb 23 15:13:18 2018
@@ -0,0 +1,13 @@
+; Test that DIFile representation upgrades with introduction of
+; optional source field.
+;
+; RUN: llvm-dis < %s.bc | FileCheck %s
+; RUN: verify-uselistorder < %s.bc
+
+!llvm.dbg.cu = !{!1}
+!llvm.module.flags = !{!3}
+
+!1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 5.0.1 (tags/RELEASE_501/final)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
+; CHECK-NOT: !DIFile({{.*}}source:{{.*}})
+!2 = !DIFile(filename: "a.c", directory: "/test")
+!3 = !{i32 2, !"Debug Info Version", i32 3}

Added: llvm/trunk/test/Bitcode/metadata-source.ll.bc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/metadata-source.ll.bc?rev=325973&view=auto
==============================================================================
Binary file - no diff available.

Propchange: llvm/trunk/test/Bitcode/metadata-source.ll.bc
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: llvm/trunk/test/CodeGen/Generic/dwarf-source.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/dwarf-source.ll?rev=325973&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Generic/dwarf-source.ll (added)
+++ llvm/trunk/test/CodeGen/Generic/dwarf-source.ll Fri Feb 23 15:13:18 2018
@@ -0,0 +1,61 @@
+; Source text provided by IR should be passed through to asm.
+; It is emitted to an object file only for DWARF 5 or later.
+
+; Darwin clamps the line table at DWARF v2 so XFAIL this test.
+; 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=obj -o %t4.o %s
+; RUN: llvm-dwarfdump -debug-line %t4.o | FileCheck %s --check-prefix=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
+
+; 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
+
+; OBJ-5: file_names[ 0]:
+; OBJ-5-NEXT: name: "t1.h"
+; OBJ-5-NEXT: dir_index: 1
+; OBJ-5-NEXT: source: "11111111111111111111111111111111"
+; OBJ-5: file_names[ 1]:
+; OBJ-5-NEXT: name: "t2.h"
+; OBJ-5-NEXT: dir_index: 1
+; OBJ-5-NEXT: source: "22222222222222222222222222222222"
+
+; ModuleID = 't.c'
+source_filename = "t.c"
+
+ at t1 = global i32 1, align 4, !dbg !0
+ at t2 = global i32 0, align 4, !dbg !6
+
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!11, !12, !13}
+!llvm.ident = !{!14}
+
+!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: "/test", source: "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: "/test", source: "22222222222222222222222222222222")
+!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!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}
+!14 = !{!"clang version 7.0.0 (trunk 322159)"}

Added: llvm/trunk/test/Linker/Inputs/metadata-source-a.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/Inputs/metadata-source-a.ll?rev=325973&view=auto
==============================================================================
--- llvm/trunk/test/Linker/Inputs/metadata-source-a.ll (added)
+++ llvm/trunk/test/Linker/Inputs/metadata-source-a.ll Fri Feb 23 15:13:18 2018
@@ -0,0 +1,22 @@
+; ModuleID = 'a.c'
+source_filename = "a.c"
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+ at a = common global i32 0, align 4, !dbg !0
+
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!7, !8, !9}
+!llvm.ident = !{!10}
+
+!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
+!1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 7.0.0 (https://git.llvm.org/git/clang.git/ c12b573f9ac61655cce52628b34235f58edaf984) (https://scott.linder@llvm.org/git/llvm.git 90c4822e8541eb07891cd03e614c530c30f8aa12)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "a.c", directory: "/home/slinder1/test/link", source: "int a;\0A")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!7 = !{i32 2, !"Dwarf Version", i32 4}
+!8 = !{i32 2, !"Debug Info Version", i32 3}
+!9 = !{i32 1, !"wchar_size", i32 4}
+!10 = !{!"clang version 7.0.0 (https://git.llvm.org/git/clang.git/ c12b573f9ac61655cce52628b34235f58edaf984) (https://scott.linder@llvm.org/git/llvm.git 90c4822e8541eb07891cd03e614c530c30f8aa12)"}

Added: llvm/trunk/test/Linker/Inputs/metadata-source-b.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/Inputs/metadata-source-b.ll?rev=325973&view=auto
==============================================================================
--- llvm/trunk/test/Linker/Inputs/metadata-source-b.ll (added)
+++ llvm/trunk/test/Linker/Inputs/metadata-source-b.ll Fri Feb 23 15:13:18 2018
@@ -0,0 +1,22 @@
+; ModuleID = 'b.c'
+source_filename = "b.c"
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+ at b = common global i32 0, align 4, !dbg !0
+
+!llvm.dbg.cu = !{!2}
+!llvm.module.flags = !{!7, !8, !9}
+!llvm.ident = !{!10}
+
+!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
+!1 = distinct !DIGlobalVariable(name: "b", scope: !2, file: !3, line: 1, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 7.0.0 (https://git.llvm.org/git/clang.git/ c12b573f9ac61655cce52628b34235f58edaf984) (https://scott.linder@llvm.org/git/llvm.git 90c4822e8541eb07891cd03e614c530c30f8aa12)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
+!3 = !DIFile(filename: "b.c", directory: "/home/slinder1/test/link", source: "int b;\0A")
+!4 = !{}
+!5 = !{!0}
+!6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!7 = !{i32 2, !"Dwarf Version", i32 4}
+!8 = !{i32 2, !"Debug Info Version", i32 3}
+!9 = !{i32 1, !"wchar_size", i32 4}
+!10 = !{!"clang version 7.0.0 (https://git.llvm.org/git/clang.git/ c12b573f9ac61655cce52628b34235f58edaf984) (https://scott.linder@llvm.org/git/llvm.git 90c4822e8541eb07891cd03e614c530c30f8aa12)"}

Added: llvm/trunk/test/Linker/metadata-source.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/metadata-source.ll?rev=325973&view=auto
==============================================================================
--- llvm/trunk/test/Linker/metadata-source.ll (added)
+++ llvm/trunk/test/Linker/metadata-source.ll Fri Feb 23 15:13:18 2018
@@ -0,0 +1,4 @@
+; RUN: llvm-link %p/Inputs/metadata-source-a.ll %p/Inputs/metadata-source-b.ll -S | FileCheck %s
+
+; CHECK: !DIFile(filename: "a.c", directory: "/home/slinder1/test/link", source: "int a;\0A")
+; CHECK: !DIFile(filename: "b.c", directory: "/home/slinder1/test/link", source: "int b;\0A")

Added: llvm/trunk/test/MC/AsmParser/debug-empty-source.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/debug-empty-source.s?rev=325973&view=auto
==============================================================================
--- llvm/trunk/test/MC/AsmParser/debug-empty-source.s (added)
+++ llvm/trunk/test/MC/AsmParser/debug-empty-source.s Fri Feb 23 15:13:18 2018
@@ -0,0 +1,7 @@
+// RUN: llvm-mc %s -o -| FileCheck %s
+
+.file 1 "dir1" "foo" source ""
+.loc 1 1 0
+nop
+
+# CHECK: .file {{.*}} source ""

Added: llvm/trunk/test/MC/AsmParser/debug-no-source.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/debug-no-source.s?rev=325973&view=auto
==============================================================================
--- llvm/trunk/test/MC/AsmParser/debug-no-source.s (added)
+++ llvm/trunk/test/MC/AsmParser/debug-no-source.s Fri Feb 23 15:13:18 2018
@@ -0,0 +1,5 @@
+// RUN: llvm-mc %s | FileCheck %s
+
+.file 1 "dir1/foo"
+
+# CHECK-NOT: .file {{.*}} source

Added: llvm/trunk/test/MC/ELF/debug-file-options.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/debug-file-options.s?rev=325973&view=auto
==============================================================================
--- llvm/trunk/test/MC/ELF/debug-file-options.s (added)
+++ llvm/trunk/test/MC/ELF/debug-file-options.s Fri Feb 23 15:13:18 2018
@@ -0,0 +1,36 @@
+// RUN: llvm-mc -triple x86_64-unknown-unknown -dwarf-version 5 -filetype=obj %s -o -| llvm-dwarfdump --debug-line --debug-line-str -v - | FileCheck %s
+
+// Test combinations of options to the .file directive.
+
+        .file 1 "dir1/foo" md5 "ee87e05688663173cd6043a3a15bba6e" source "void foo() {}"
+        .file 2 "dir2/bar" source "void bar() {}" md5 "816225a0c90ca8948b70eb58be4d522f"
+        .loc 1 1 0
+        nop
+        .loc 2 1 0
+        nop
+
+# CHECK: debug_line[0x00000000]
+# CHECK: version: 5
+# CHECK: include_directories[ 0] = .debug_line_str[0x[[DIR0:[0-9a-f]+]]] = ""
+# CHECK: include_directories[ 1] = .debug_line_str[0x[[DIR1:[0-9a-f]+]]] = "dir1"
+# CHECK: include_directories[ 2] = .debug_line_str[0x[[DIR2:[0-9a-f]+]]] = "dir2"
+# CHECK-NOT: include_directories
+# CHECK: file_names[ 0]:
+# CHECK-NEXT: name: .debug_line_str[0x[[FILE1:[0-9a-f]+]]] = "foo"
+# CHECK-NEXT: dir_index: 1
+# CHECK-NEXT: md5_checksum: ee87e05688663173cd6043a3a15bba6e
+# CHECK-NEXT: source: .debug_line_str[0x[[FILE1SRC:[0-9a-f]+]]] = "void foo() {}"
+# CHECK: file_names[ 1]:
+# CHECK-NEXT: name: .debug_line_str[0x[[FILE2:[0-9a-f]+]]] = "bar"
+# CHECK-NEXT: dir_index: 2
+# CHECK-NEXT: md5_checksum: 816225a0c90ca8948b70eb58be4d522f
+# CHECK-NEXT: source: .debug_line_str[0x[[FILE2SRC:[0-9a-f]+]]] = "void bar() {}"
+
+# CHECK: .debug_line_str contents:
+# CHECK-NEXT: 0x[[DIR0]]: ""
+# CHECK-NEXT: 0x[[DIR1]]: "dir1"
+# CHECK-NEXT: 0x[[DIR2]]: "dir2"
+# CHECK-NEXT: 0x[[FILE1]]: "foo"
+# CHECK-NEXT: 0x[[FILE1SRC]]: "void foo() {}"
+# CHECK-NEXT: 0x[[FILE2]]: "bar"
+# CHECK-NEXT: 0x[[FILE2SRC]]: "void bar() {}"

Added: llvm/trunk/test/MC/ELF/debug-source.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/debug-source.s?rev=325973&view=auto
==============================================================================
--- llvm/trunk/test/MC/ELF/debug-source.s (added)
+++ llvm/trunk/test/MC/ELF/debug-source.s Fri Feb 23 15:13:18 2018
@@ -0,0 +1,32 @@
+// RUN: llvm-mc -triple x86_64-unknown-unknown -dwarf-version 5 -filetype=obj %s -o -| llvm-dwarfdump --debug-line --debug-line-str -v - | FileCheck %s
+
+        .file 1 "dir1/foo"   source "void foo() {}"
+        .file 2 "dir2" "bar" source "void bar()\n{\n}"
+        .loc 1 1 0
+        nop
+        .loc 2 1 0
+        nop
+
+# CHECK: debug_line[0x00000000]
+# CHECK: version: 5
+# CHECK: include_directories[ 0] = .debug_line_str[0x[[DIR0:[0-9a-f]+]]] = ""
+# CHECK: include_directories[ 1] = .debug_line_str[0x[[DIR1:[0-9a-f]+]]] = "dir1"
+# CHECK: include_directories[ 2] = .debug_line_str[0x[[DIR2:[0-9a-f]+]]] = "dir2"
+# CHECK-NOT: include_directories
+# CHECK: file_names[ 0]:
+# CHECK-NEXT: name: .debug_line_str[0x[[FILE1:[0-9a-f]+]]] = "foo"
+# CHECK-NEXT: dir_index: 1
+# CHECK-NEXT: source: .debug_line_str[0x[[FILE1SRC:[0-9a-f]+]]] = "void foo() {}"
+# CHECK: file_names[ 1]:
+# CHECK-NEXT: name: .debug_line_str[0x[[FILE2:[0-9a-f]+]]] = "bar"
+# CHECK-NEXT: dir_index: 2
+# CHECK-NEXT: source: .debug_line_str[0x[[FILE2SRC:[0-9a-f]+]]] = "void bar()\n{\n}"
+
+# CHECK: .debug_line_str contents:
+# CHECK-NEXT: 0x[[DIR0]]: ""
+# CHECK-NEXT: 0x[[DIR1]]: "dir1"
+# CHECK-NEXT: 0x[[DIR2]]: "dir2"
+# CHECK-NEXT: 0x[[FILE1]]: "foo"
+# CHECK-NEXT: 0x[[FILE1SRC]]: "void foo() {}"
+# CHECK-NEXT: 0x[[FILE2]]: "bar"
+# CHECK-NEXT: 0x[[FILE2SRC]]: "void bar()\n{\n}"

Added: llvm/trunk/test/tools/llvm-objdump/Inputs/embedded-source
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/Inputs/embedded-source?rev=325973&view=auto
==============================================================================
Binary file - no diff available.

Propchange: llvm/trunk/test/tools/llvm-objdump/Inputs/embedded-source
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: llvm/trunk/test/tools/llvm-objdump/embedded-source.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/embedded-source.test?rev=325973&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/embedded-source.test (added)
+++ llvm/trunk/test/tools/llvm-objdump/embedded-source.test Fri Feb 23 15:13:18 2018
@@ -0,0 +1,22 @@
+; RUN: llvm-objdump -disassemble -line-numbers %p/Inputs/embedded-source | FileCheck --check-prefix=LINE %s
+; RUN: llvm-objdump -disassemble -source       %p/Inputs/embedded-source | FileCheck --check-prefix=SOURCE %s
+
+; LINE: main:
+; LINE-NEXT: ; {{.*}}embedded-source.c:1
+; LINE-NEXT: pushq %rbp
+; LINE: ; {{.*}}embedded-source.c:2
+; LINE-NEXT: movl $2
+; LINE: ; {{.*}}embedded-source.c:3
+; LINE: addl $1
+; LINE: ; {{.*}}embedded-source.c:4
+; LINE: retq
+
+; SOURCE: main:
+; SOURCE-NEXT: ; int main(int argc, char *argv[]) {
+; SOURCE-NEXT: pushq %rbp
+; SOURCE: ; int i = 2;
+; SOURCE-NEXT: movl $2
+; SOURCE: ; i += 1;
+; SOURCE: addl $1
+; SOURCE: ; return i;
+; SOURCE: retq




More information about the llvm-commits mailing list