diff --git a/llvm/test/CodeGen/Generic/dwarf-md5.ll b/llvm/test/CodeGen/Generic/dwarf-md5.ll --- a/llvm/test/CodeGen/Generic/dwarf-md5.ll +++ b/llvm/test/CodeGen/Generic/dwarf-md5.ll @@ -3,18 +3,22 @@ ; REQUIRES: object-emission ; RUN: %llc_dwarf -dwarf-version 4 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM-4 +; RUN: %llc_dwarf -dwarf-version 4 -filetype=asm -dwarf-directory=0 -o - %s | FileCheck %s --check-prefix=ASM-4-GAS ; RUN: %llc_dwarf -dwarf-version 5 -filetype=asm -o - %s | FileCheck %s --check-prefix=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 ; RUN: %llc_dwarf -dwarf-version 5 -filetype=obj -o %t5.o %s ; RUN: llvm-dwarfdump -debug-line %t5.o | FileCheck %s --check-prefixes=OBJ,OBJ-5 +; ASM-4-GAS: .file 1 "/scratch{{/|\\\\}}t1.h" +; ASM-4-GAS: .file 2 "/scratch{{/|\\\\}}t2.h" + ; ASM-4-NOT: .file 0 -; ASM-4: .file 1 "/scratch{{.*[/\\]}}t1.h" +; ASM-4: .file 1 "/scratch" "t1.h" ; ASM-4-NOT: md5 -; ASM-4: .file 2 "/scratch{{.*[/\\]}}t2.h" +; ASM-4: .file 2 "/scratch" "t2.h" ; ASM-4-NOT: md5 -; ASM-5: .file 0 "/scratch{{.*[/\\]}}t.c" md5 0x00000000000000000000000000000000 +; ASM-5: .file 0 "/scratch" "t.c" md5 0x00000000000000000000000000000000 ; ASM-5: .file 1 "t1.h" md5 0x11111111111111111111111111111111 ; ASM-5: .file 2 "t2.h" md5 0x22222222222222222222222222222222 diff --git a/llvm/test/CodeGen/Generic/dwarf-source.ll b/llvm/test/CodeGen/Generic/dwarf-source.ll --- a/llvm/test/CodeGen/Generic/dwarf-source.ll +++ b/llvm/test/CodeGen/Generic/dwarf-source.ll @@ -9,9 +9,9 @@ ; RUN: %llc_dwarf -dwarf-version 5 -filetype=obj -o %t5.o %s ; RUN: llvm-dwarfdump -debug-line %t5.o | FileCheck %s --check-prefixes=OBJ,OBJ-5 -; ASM-4: .file 1 "/test{{.*[/\\]}}t1.h" source "11111111111111111111111111111111" -; ASM-4: .file 2 "/test{{.*[/\\]}}t2.h" source "22222222222222222222222222222222" -; ASM-5: .file 0 "/test{{.*[/\\]}}t.c" source "00000000000000000000000000000000" +; ASM-4: .file 1 "/test" "t1.h" source "11111111111111111111111111111111" +; ASM-4: .file 2 "/test" "t2.h" source "22222222222222222222222222222222" +; ASM-5: .file 0 "/test" "t.c" source "00000000000000000000000000000000" ; ASM-5: .file 1 "t1.h" source "11111111111111111111111111111111" ; ASM-5: .file 2 "t2.h" source "22222222222222222222222222222222" diff --git a/llvm/test/DebugInfo/Generic/lto-comp-dir.ll b/llvm/test/DebugInfo/Generic/lto-comp-dir.ll --- a/llvm/test/DebugInfo/Generic/lto-comp-dir.ll +++ b/llvm/test/DebugInfo/Generic/lto-comp-dir.ll @@ -27,8 +27,8 @@ ; interpretations depending on which CU lead to the table - so ensure that ; full paths are always emitted in this case, never comp_dir relative. -; ASM: .file 1 "/tmp/dbginfo/a{{[/\\]+}}a.cpp" -; ASM: .file 2 "/tmp/dbginfo/b{{[/\\]+}}b.cpp" +; ASM: .file 1 "/tmp/dbginfo/a" "a.cpp" +; ASM: .file 2 "/tmp/dbginfo/b" "b.cpp" ; Generated from the following source compiled to bitcode from within their ; respective directories (with debug info) and linked together with llvm-link diff --git a/llvm/test/DebugInfo/NVPTX/dbg-declare-alloca.ll b/llvm/test/DebugInfo/NVPTX/dbg-declare-alloca.ll --- a/llvm/test/DebugInfo/NVPTX/dbg-declare-alloca.ll +++ b/llvm/test/DebugInfo/NVPTX/dbg-declare-alloca.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -mtriple=nvptx64-nvidia-cuda | FileCheck %s +; RUN: llc < %s -mtriple=nvptx64-nvidia-cuda -dwarf-directory=0 | FileCheck %s ; CHECK: .target sm_20, debug diff --git a/llvm/test/DebugInfo/NVPTX/debug-loc-offset.ll b/llvm/test/DebugInfo/NVPTX/debug-loc-offset.ll --- a/llvm/test/DebugInfo/NVPTX/debug-loc-offset.ll +++ b/llvm/test/DebugInfo/NVPTX/debug-loc-offset.ll @@ -1,4 +1,4 @@ -; RUN: llc -mtriple=nvptx64-nvidia-cuda < %s | FileCheck %s +; RUN: llc -mtriple=nvptx64-nvidia-cuda -dwarf-directory=0 < %s | FileCheck %s ; CHECK: .target sm_{{[0-9]+}}, debug diff --git a/llvm/test/DebugInfo/X86/dbg-file-name.ll b/llvm/test/DebugInfo/X86/dbg-file-name.ll --- a/llvm/test/DebugInfo/X86/dbg-file-name.ll +++ b/llvm/test/DebugInfo/X86/dbg-file-name.ll @@ -1,4 +1,4 @@ -; RUN: llc -enable-dwarf-directory -mtriple x86_64-apple-darwin10.0.0 < %s | FileCheck %s +; RUN: llc -mtriple x86_64-apple-darwin10.0.0 < %s | FileCheck %s ; Verify that the file name is relative to the directory. ; rdar://problem/8884898 diff --git a/llvm/test/DebugInfo/X86/inline-asm-locs.ll b/llvm/test/DebugInfo/X86/inline-asm-locs.ll --- a/llvm/test/DebugInfo/X86/inline-asm-locs.ll +++ b/llvm/test/DebugInfo/X86/inline-asm-locs.ll @@ -22,7 +22,7 @@ ; CHECK: .file 2 "B.asm" ; CHECK: .loc 1 111 ; CHECK: .loc 2 222 -; CHECK: .file 3 "{{.*[/\\]}}test.c" +; CHECK: .file 3 "{{.*}}" "test.c" ; CHECK: .loc 3 14 0 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp --- a/llvm/tools/llc/llc.cpp +++ b/llvm/tools/llc/llc.cpp @@ -126,9 +126,10 @@ static cl::opt ShowMCEncoding("show-mc-encoding", cl::Hidden, cl::desc("Show encoding in .s output")); -static cl::opt EnableDwarfDirectory( - "enable-dwarf-directory", cl::Hidden, - cl::desc("Use .file directives with an explicit directory.")); +static cl::opt + DwarfDirectory("dwarf-directory", cl::Hidden, + cl::desc("Use .file directives with an explicit directory"), + cl::init(true)); static cl::opt AsmVerbose("asm-verbose", cl::desc("Add comments to directives."), @@ -473,7 +474,7 @@ TargetMachine::parseBinutilsVersion(BinutilsVersion); Options.DisableIntegratedAS = NoIntegratedAssembler; Options.MCOptions.ShowMCEncoding = ShowMCEncoding; - Options.MCOptions.MCUseDwarfDirectory = EnableDwarfDirectory; + Options.MCOptions.MCUseDwarfDirectory = DwarfDirectory; Options.MCOptions.AsmVerbose = AsmVerbose; Options.MCOptions.PreserveAsmComments = PreserveComments; Options.MCOptions.IASSearchPaths = IncludeDirs;