Skip to content

Commit a52e486

Browse files
committed
[llvm-objdump,test] Fix source-interleave.ll when /proc/self/cwd is unavailable
e.g. on Mach-O
1 parent 7a6acd9 commit a52e486

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
; RELOC-NEXT: R_RISCV_SUB_ULEB128
1212

1313
; CHECK: ; foo():
14-
; CHECK-NEXT: /proc/self/cwd/a.c:2
14+
; CHECK-NEXT: a.c:2
1515
; CHECK-NEXT: ; int foo(int x) {
1616
; CHECK-NEXT: 0: addi sp, sp, -0x10
1717
; CHECK-NEXT: 2: sd ra, 0x8(sp)
18-
; CHECK-NEXT: /proc/self/cwd/a.c:3
18+
; CHECK-NEXT: a.c:3
1919
; CHECK-NEXT: ; ext();
2020
; CHECK-NEXT: 4: auipc ra, 0x0
2121

@@ -35,7 +35,7 @@ void foo2() {
3535
}
3636
}
3737
;--- gen
38-
clang --target=riscv64-linux -S -emit-llvm -g -O1 a.c -o - | sed -E '/^attribute/s/,-[-0-9a-z]+//g'
38+
clang --target=riscv64-linux -S -emit-llvm -g -O1 -fdebug-compilation-dir=. a.c -o - | sed -E '/^attribute/s/,-[-0-9a-z]+//g'
3939
;--- a.ll
4040
; ModuleID = 'a.c'
4141
source_filename = "a.c"
@@ -76,7 +76,7 @@ attributes #2 = { nounwind }
7676
!llvm.module.flags = !{!2, !3, !4, !5, !6, !8, !9, !10, !11, !12}
7777

7878
!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)
79-
!1 = !DIFile(filename: "a.c", directory: "/proc/self/cwd", checksumkind: CSK_MD5, checksum: "4791066d0b0e4fd9c4b4df1c56f349cb")
79+
!1 = !DIFile(filename: "a.c", directory: ".", checksumkind: CSK_MD5, checksum: "4791066d0b0e4fd9c4b4df1c56f349cb")
8080
!2 = !{i32 7, !"Dwarf Version", i32 5}
8181
!3 = !{i32 2, !"Debug Info Version", i32 3}
8282
!4 = !{i32 1, !"wchar_size", i32 4}

0 commit comments

Comments
 (0)