2 ; RUN: llc -emit-call-site-info %s -mtriple=mips -filetype=obj -o -| llvm-dwarfdump -| FileCheck %s
4 ; RUN: llc -emit-call-site-info %s -mtriple=mipsel -filetype=obj -o -| llvm-dwarfdump -| FileCheck %s
6 ; RUN: llc -emit-call-site-info %s -mtriple=mips64 -filetype=obj -o -| llvm-dwarfdump -| FileCheck %s
8 ; RUN: llc -emit-call-site-info %s -mtriple=mips64el -filetype=obj -o -| llvm-dwarfdump -| FileCheck %s
11 ;; __attribute__((noinline))
12 ;; extern void f1(int a);
13 ;; __attribute__((noinline))
19 ;; Command: clang -g -O2 -target mips-linux-gnu -S -emit-llvm m.c -c
20 ;; Confirm that DW_AT_low_pc (call return address) points to instruction after call delay slot.
22 ;; Test mips, mipsel, mips64, mips64el:
23 ; CHECK: DW_TAG_GNU_call_site
24 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "f1"
25 ; CHECK-NEXT: DW_AT_low_pc (0x{{(00000000)?}}00000010)
28 source_filename = "m.c"
29 target datalayout = "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64"
30 target triple = "mips-unknown-linux-gnu"
32 ; Function Attrs: noinline nounwind
33 define dso_local i32 @main() local_unnamed_addr !dbg !12 {
35 call void @llvm.dbg.value(metadata i32 10, metadata !16, metadata !DIExpression()), !dbg !17
36 tail call void @f1(i32 signext 10), !dbg !17
37 call void @llvm.dbg.value(metadata i32 11, metadata !16, metadata !DIExpression()), !dbg !17
41 declare !dbg !4 dso_local void @f1(i32 signext) local_unnamed_addr
43 ; Function Attrs: nounwind readnone speculatable willreturn
44 declare void @llvm.dbg.value(metadata, metadata, metadata)
47 !llvm.module.flags = !{!8, !9, !10}
50 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 11.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, splitDebugInlining: false, nameTableKind: None)
51 !1 = !DIFile(filename: "m.c", directory: "/dir")
54 !4 = !DISubprogram(name: "f1", scope: !1, file: !1, line: 2, type: !5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
55 !5 = !DISubroutineType(types: !6)
57 !7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
58 !8 = !{i32 7, !"Dwarf Version", i32 4}
59 !9 = !{i32 2, !"Debug Info Version", i32 3}
60 !10 = !{i32 1, !"wchar_size", i32 4}
61 !11 = !{!"clang version 11.0.0"}
62 !12 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 5, type: !13, scopeLine: 5, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !15)
63 !13 = !DISubroutineType(types: !14)
66 !16 = !DILocalVariable(name: "x", scope: !12, file: !1, line: 6, type: !7)
67 !17 = !DILocation(line: 0, scope: !12)