xref: /aosp_15_r20/external/llvm/test/DebugInfo/X86/frame-register.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc %s -filetype=obj -o - | llvm-dwarfdump --debug-dump=info - | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; CHECK: DW_TAG_variable
3*9880d681SAndroid Build Coastguard Worker;                                                      DW_OP_fbreg
4*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: DW_AT_location [DW_FORM_exprloc]      (<0x2> 91 00 )
5*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: DW_AT_name {{.*}}"i"
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-m:e-p:32:32-i64:64-f80:128-n8:16:32:64-S128"
8*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-apple-darwin"
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind uwtable
11*9880d681SAndroid Build Coastguard Workerdeclare i32 @foo(i32 %i) #0
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind readnone
14*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.dbg.declare(metadata, metadata, metadata) #1
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind uwtable
17*9880d681SAndroid Build Coastguard Workerdefine i32 @main() #0 !dbg !9 {
18*9880d681SAndroid Build Coastguard Workerentry:
19*9880d681SAndroid Build Coastguard Worker  %retval = alloca i32, align 4
20*9880d681SAndroid Build Coastguard Worker  %i = alloca i32, align 4
21*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %retval
22*9880d681SAndroid Build Coastguard Worker  call void @llvm.dbg.declare(metadata i32* %i, metadata !20, metadata !16), !dbg !21
23*9880d681SAndroid Build Coastguard Worker  store i32 20, i32* %i, align 4, !dbg !21
24*9880d681SAndroid Build Coastguard Worker  %0 = load i32, i32* %i, align 4, !dbg !22
25*9880d681SAndroid Build Coastguard Worker  %call = call i32 @foo(i32 %0), !dbg !23
26*9880d681SAndroid Build Coastguard Worker  ret i32 %call, !dbg !24
27*9880d681SAndroid Build Coastguard Worker}
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Workerattributes #0 = { nounwind uwtable  }
30*9880d681SAndroid Build Coastguard Workerattributes #1 = { nounwind readnone }
31*9880d681SAndroid Build Coastguard Worker
32*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!0}
33*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!12, !13}
34*9880d681SAndroid Build Coastguard Worker!llvm.ident = !{!14}
35*9880d681SAndroid Build Coastguard Worker
36*9880d681SAndroid Build Coastguard Worker!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
37*9880d681SAndroid Build Coastguard Worker!1 = !DIFile(filename: "x.c", directory: "")
38*9880d681SAndroid Build Coastguard Worker!2 = !{}
39*9880d681SAndroid Build Coastguard Worker!4 = distinct !DISubprogram(name: "foo", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !1, scope: !5, type: !6, variables: !2)
40*9880d681SAndroid Build Coastguard Worker!5 = !DIFile(filename: "x.c", directory: "")
41*9880d681SAndroid Build Coastguard Worker!6 = !DISubroutineType(types: !7)
42*9880d681SAndroid Build Coastguard Worker!7 = !{!8, !8}
43*9880d681SAndroid Build Coastguard Worker!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
44*9880d681SAndroid Build Coastguard Worker!9 = distinct !DISubprogram(name: "main", line: 8, isLocal: false, isDefinition: true, isOptimized: false, unit: !0, scopeLine: 9, file: !1, scope: !5, type: !10, variables: !2)
45*9880d681SAndroid Build Coastguard Worker!10 = !DISubroutineType(types: !11)
46*9880d681SAndroid Build Coastguard Worker!11 = !{!8}
47*9880d681SAndroid Build Coastguard Worker!12 = !{i32 2, !"Dwarf Version", i32 4}
48*9880d681SAndroid Build Coastguard Worker!13 = !{i32 2, !"Debug Info Version", i32 3}
49*9880d681SAndroid Build Coastguard Worker!14 = !{!"clang version 3.7.0"}
50*9880d681SAndroid Build Coastguard Worker!15 = !DILocalVariable(name: "i", line: 2, arg: 1, scope: !4, file: !5, type: !8)
51*9880d681SAndroid Build Coastguard Worker!16 = !DIExpression()
52*9880d681SAndroid Build Coastguard Worker!17 = !DILocation(line: 2, column: 10, scope: !4)
53*9880d681SAndroid Build Coastguard Worker!18 = !DILocation(line: 4, column: 10, scope: !4)
54*9880d681SAndroid Build Coastguard Worker!19 = !DILocation(line: 4, column: 3, scope: !4)
55*9880d681SAndroid Build Coastguard Worker!20 = !DILocalVariable(name: "i", line: 10, scope: !9, file: !5, type: !8)
56*9880d681SAndroid Build Coastguard Worker!21 = !DILocation(line: 10, column: 7, scope: !9)
57*9880d681SAndroid Build Coastguard Worker!22 = !DILocation(line: 11, column: 15, scope: !9)
58*9880d681SAndroid Build Coastguard Worker!23 = !DILocation(line: 11, column: 10, scope: !9)
59*9880d681SAndroid Build Coastguard Worker!24 = !DILocation(line: 11, column: 3, scope: !9)
60