blob: 830f6705c96720945a7e724ce337bac688d0db48 [file] [log] [blame]
Eugene Zemtsov82d60d62018-03-13 17:54:29 +00001; Make sure that absolute source dir is detected correctly regardless of the platform.
2; REQUIRES: object-emission
3; RUN: %llc_dwarf -filetype=obj -o %t < %s
4; RUN: echo -n 0x > %t.posix_relative_func
5; RUN: echo -n 0x > %t.posix_absolute_func
6; RUN: echo -n 0x > %t.win_func
7; RUN: llvm-nm %t | grep posix_absolute_func >> %t.posix_absolute_func
8; RUN: llvm-nm %t | grep posix_relative_func >> %t.posix_relative_func
9; RUN: llvm-nm %t | grep win_func >> %t.win_func
10; RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false --obj %t < %t.posix_absolute_func | FileCheck %s --check-prefix=POSIX_A
11; RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false --obj %t < %t.posix_relative_func | FileCheck %s --check-prefix=POSIX_R
12; RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false --obj %t < %t.win_func | FileCheck %s --check-prefix=WIN
13
14;POSIX_A: posix_absolute_func
15;POSIX_A: /absolute/posix/path{{[\/]}}posix.c
16
17;POSIX_R: posix_relative_func
18;POSIX_R: /ABSOLUTE/CU/PATH{{[\/]}}relative/posix/path{{[\/]}}posix2.c
19
20;WIN: win_func
21;WIN: E:\absolute\windows\path{{[\/]}}win.c
22
23
24target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
25target triple = "x86_64-pc-linux-gnu"
26
27define i32 @win_func() #0 !dbg !54 {
28 ret i32 5, !dbg !511
29}
30
31define i32 @posix_absolute_func() #0 !dbg !34 {
32 ret i32 3, !dbg !311
33}
34
35define i32 @posix_relative_func() #0 !dbg !44 {
36 ret i32 4, !dbg !411
37}
38
39!llvm.dbg.cu = !{!50, !30, !40}
40!llvm.module.flags = !{!8, !9}
41!llvm.ident = !{!10}
42!8 = !{i32 2, !"Dwarf Version", i32 4}
43!9 = !{i32 2, !"Debug Info Version", i32 3}
44!10 = !{!"clang"}
45
46!50 = distinct !DICompileUnit(language: DW_LANG_C99, file: !512, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !52)
47!51 = !DIFile(filename: "win.c", directory: "E:\\absolute\\windows\\path")
48!52 = !{}
49!53 = !{!54}
50!54 = distinct !DISubprogram(name: "win_func", scope: !51, file: !51, line: 55, type: !55, unit: !50, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, variables: !52)
51!55 = !DISubroutineType(types: !56)
52!56 = !{!57}
53!57 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
54!511 = !DILocation(line: 55, column: 2, scope: !54)
55!512 = !DIFile(filename: "a.c", directory: "/WIN_CU/PATH")
56
57!30 = distinct !DICompileUnit(language: DW_LANG_C99, file: !312, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !32)
58!31 = !DIFile(filename: "posix.c", directory: "/absolute/posix/path")
59!32 = !{}
60!33 = !{!34}
61!34 = distinct !DISubprogram(name: "posix_absolute_func", scope: !31, file: !31, line: 33, type: !35, unit: !30, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, variables: !32)
62!35 = !DISubroutineType(types: !36)
63!36 = !{!37}
64!37 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
65!311 = !DILocation(line: 33, column: 2, scope: !34)
66!312 = !DIFile(filename: "b.c", directory: "/POSIX_CU/PATH")
67
68!40 = distinct !DICompileUnit(language: DW_LANG_C99, file: !412, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !42)
69!41 = !DIFile(filename: "posix2.c", directory: "relative/posix/path")
70!42 = !{}
71!43 = !{!44}
72!44 = distinct !DISubprogram(name: "posix_relative_func", scope: !41, file: !41, line: 44, type: !45, unit: !40, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, variables: !42)
73!45 = !DISubroutineType(types: !46)
74!46 = !{!47}
75!47 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
76!411 = !DILocation(line: 44, column: 2, scope: !44)
77!412 = !DIFile(filename: "c.c", directory: "/ABSOLUTE/CU/PATH")
78