brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.7 KiB · 7e408af Raw
76 lines · plain
1; Make sure that absolute source dir is detected correctly regardless of the platform.2 3; On powerpc llvm-nm describes win_func as a global variable, not a function. It breaks the test.4; On PlayStation, (pre-relocated) .debug_aranges cause symbolization to fail, also breaking the test.5; These are not essential to DWARF path handling code we're testing here.6; UNSUPPORTED: target=powerpc{{.*}}, target=x86_64-{{.*-ps[45]}}7; REQUIRES: object-emission8; RUN: %llc_dwarf -O0 -filetype=obj -o %t < %s9; RUN: llvm-nm --radix=o %t | grep posix_absolute_func > %t.posix_absolute_func10; RUN: llvm-nm --radix=o %t | grep posix_relative_func > %t.posix_relative_func11; RUN: llvm-nm --radix=o %t | grep win_func > %t.win_func12; RUN: llvm-symbolizer --functions=linkage --inlining --no-demangle --obj %t < %t.posix_absolute_func | FileCheck %s --check-prefix=POSIX_A13; RUN: llvm-symbolizer --functions=linkage --inlining --no-demangle --obj %t < %t.posix_relative_func | FileCheck %s --check-prefix=POSIX_R14; RUN: llvm-symbolizer --functions=linkage --inlining --no-demangle --obj %t < %t.win_func | FileCheck %s --check-prefix=WIN15 16;POSIX_A: posix_absolute_func17;POSIX_A: /absolute/posix/path{{[\/]}}posix.c18 19;POSIX_R: posix_relative_func20;POSIX_R: /ABSOLUTE/CU/PATH{{[\/]}}relative/posix/path{{[\/]}}posix2.c21 22;WIN: win_func23;WIN: E:\absolute\windows\path{{[\/]}}win.c24 25define i32 @win_func() #0 !dbg !54 {26  ret i32 5, !dbg !51127}28 29define i32 @posix_absolute_func() #0 !dbg !34 {30  ret i32 3, !dbg !31131}32 33define i32 @posix_relative_func() #0 !dbg !44 {34  ret i32 4, !dbg !41135}36 37!llvm.dbg.cu = !{!50, !30, !40}38!llvm.module.flags = !{!8, !9}39!llvm.ident = !{!10}40!8 = !{i32 2, !"Dwarf Version", i32 4}41!9 = !{i32 2, !"Debug Info Version", i32 3}42!10 = !{!"clang"}43 44!50 = distinct !DICompileUnit(language: DW_LANG_C99, file: !512, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !52)45!51 = !DIFile(filename: "win.c", directory: "E:\\absolute\\windows\\path")46!52 = !{}47!53 = !{!54}48!54 = distinct !DISubprogram(name: "win_func", scope: !51, file: !51, line: 55, type: !55, unit: !50, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, retainedNodes: !52)49!55 = !DISubroutineType(types: !56)50!56 = !{!57}51!57 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)52!511 = !DILocation(line: 55, column: 2, scope: !54)53!512 = !DIFile(filename: "a.c", directory: "/WIN_CU/PATH")54 55!30 = distinct !DICompileUnit(language: DW_LANG_C99, file: !312, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !32)56!31 = !DIFile(filename: "posix.c", directory: "/absolute/posix/path")57!32 = !{}58!33 = !{!34}59!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, retainedNodes: !32)60!35 = !DISubroutineType(types: !36)61!36 = !{!37}62!37 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)63!311 = !DILocation(line: 33, column: 2, scope: !34)64!312 = !DIFile(filename: "b.c", directory: "/POSIX_CU/PATH")65 66!40 = distinct !DICompileUnit(language: DW_LANG_C99, file: !412, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !42)67!41 = !DIFile(filename: "posix2.c", directory: "relative/posix/path")68!42 = !{}69!43 = !{!44}70!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, retainedNodes: !42)71!45 = !DISubroutineType(types: !46)72!46 = !{!47}73!47 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)74!411 = !DILocation(line: 44, column: 2, scope: !44)75!412 = !DIFile(filename: "c.c", directory: "/ABSOLUTE/CU/PATH")76