[llvm] a52e486 - [llvm-objdump,test] Fix source-interleave.ll when /proc/self/cwd is unavailable

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 9 22:43:08 PDT 2024


Author: Fangrui Song
Date: 2024-08-09T22:43:00-07:00
New Revision: a52e4866f92b11197004fac836caa56a58344cd7

URL: https://github.com/llvm/llvm-project/commit/a52e4866f92b11197004fac836caa56a58344cd7
DIFF: https://github.com/llvm/llvm-project/commit/a52e4866f92b11197004fac836caa56a58344cd7.diff

LOG: [llvm-objdump,test] Fix source-interleave.ll when /proc/self/cwd is unavailable

e.g. on Mach-O

Added: 
    

Modified: 
    llvm/test/tools/llvm-objdump/ELF/RISCV/source-interleave.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/llvm-objdump/ELF/RISCV/source-interleave.ll b/llvm/test/tools/llvm-objdump/ELF/RISCV/source-interleave.ll
index 88c48096544a24..69821a492efaec 100644
--- a/llvm/test/tools/llvm-objdump/ELF/RISCV/source-interleave.ll
+++ b/llvm/test/tools/llvm-objdump/ELF/RISCV/source-interleave.ll
@@ -11,11 +11,11 @@
 ; RELOC-NEXT: R_RISCV_SUB_ULEB128
 
 ; CHECK:      ; foo():
-; CHECK-NEXT: /proc/self/cwd/a.c:2
+; CHECK-NEXT: a.c:2
 ; CHECK-NEXT: ; int foo(int x) {
 ; CHECK-NEXT:   0: addi    sp, sp, -0x10
 ; CHECK-NEXT:   2: sd      ra, 0x8(sp)
-; CHECK-NEXT: /proc/self/cwd/a.c:3
+; CHECK-NEXT: a.c:3
 ; CHECK-NEXT: ; ext();
 ; CHECK-NEXT:   4: auipc   ra, 0x0
 
@@ -35,7 +35,7 @@ void foo2() {
   }
 }
 ;--- gen
-clang --target=riscv64-linux -S -emit-llvm -g -O1 a.c -o - | sed -E '/^attribute/s/,-[-0-9a-z]+//g'
+clang --target=riscv64-linux -S -emit-llvm -g -O1 -fdebug-compilation-dir=. a.c -o - | sed -E '/^attribute/s/,-[-0-9a-z]+//g'
 ;--- a.ll
 ; ModuleID = 'a.c'
 source_filename = "a.c"
@@ -76,7 +76,7 @@ attributes #2 = { nounwind }
 !llvm.module.flags = !{!2, !3, !4, !5, !6, !8, !9, !10, !11, !12}
 
 !0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)
-!1 = !DIFile(filename: "a.c", directory: "/proc/self/cwd", checksumkind: CSK_MD5, checksum: "4791066d0b0e4fd9c4b4df1c56f349cb")
+!1 = !DIFile(filename: "a.c", directory: ".", checksumkind: CSK_MD5, checksum: "4791066d0b0e4fd9c4b4df1c56f349cb")
 !2 = !{i32 7, !"Dwarf Version", i32 5}
 !3 = !{i32 2, !"Debug Info Version", i32 3}
 !4 = !{i32 1, !"wchar_size", i32 4}


        


More information about the llvm-commits mailing list