1; REQUIRES: x86
2; UNSUPPORTED: system-windows
3
4; RUN: rm -rf %t; mkdir %t
5; RUN: llvm-as %s -o %t/test.o
6
7; RUN: %lld %t/test.o -o %t/test
8; RUN: llvm-nm -pa %t/test | FileCheck %s --check-prefixes CHECK,NOOBJPATH
9
10; RUN: %lld %t/test.o -o %t/test -object_path_lto %t/lto-temps
11; RUN: llvm-nm -pa %t/test | FileCheck %s --check-prefixes CHECK,OBJPATH-DIR -DDIR=%t/lto-temps
12
13;; check that the object path can be an existing file
14; RUN: touch %t/lto-tmp.o
15; RUN: %lld %t/test.o -o %t/test -object_path_lto %t/lto-tmp.o
16; RUN: llvm-nm -pa %t/test | FileCheck %s --check-prefixes CHECK,OBJPATH-FILE -DFILE=%t/lto-tmp.o
17
18
19; CHECK:             0000000000000000                - 00 0000    SO /tmp/test.cpp
20; NOOBJPATH-NEXT:    0000000000000000                - 03 0001   OSO /tmp/lto.tmp
21;; check that modTime is nonzero when `-object_path_lto` is provided
22; OBJPATH-DIR-NEXT:  {{[0-9a-f]*[1-9a-f]+[0-9a-f]*}} - 03 0001   OSO [[DIR]]/0.x86_64.lto.o
23; OBJPATH-FILE-NEXT: {{[0-9a-f]*[1-9a-f]+[0-9a-f]*}} - 03 0001   OSO [[FILE]]
24; CHECK-NEXT:        {{[0-9a-f]+}}                   - 01 0000   FUN _main
25; CHECK-NEXT:        0000000000000001                - 00 0000   FUN
26; CHECK-NEXT:        0000000000000000                - 01 0000    SO
27; CHECK-NEXT:        {{[0-9a-f]+}}                   T _main
28
29target triple = "x86_64-apple-macosx10.15.0"
30target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
31
32define void @main() #0 !dbg !4 {
33  ret void
34}
35
36!llvm.module.flags = !{ !0, !1 }
37!llvm.dbg.cu = !{!2}
38
39!0 = !{i32 7, !"Dwarf Version", i32 4}
40!1 = !{i32 2, !"Debug Info Version", i32 3}
41!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, emissionKind: FullDebug)
42!3 = !DIFile(filename: "test.cpp", directory: "/tmp")
43!4 = distinct !DISubprogram(name: "main", scope: !3, file: !3, line: 1, type: !5, scopeLine: 1, unit: !2)
44!5 = !DISubroutineType(types: !6)
45!6 = !{}
46