|
1 |
| -; RUN: llc -mtriple arm-apple-darwin -O0 -filetype asm -o - %s | FileCheck %s |
| 1 | +; RUN: llc -mtriple=arm-apple-darwin -O0 -o - %s | FileCheck %s |
2 | 2 | ; Use DW_OP_breg in variable's location expression if the variable is in a stack slot.
|
3 | 3 |
|
4 |
| -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64" |
5 |
| -target triple = "arm-apple-darwin" |
| 4 | +; CHECK: @ DW_OP_breg |
6 | 5 |
|
7 | 6 | %struct.SVal = type { i8*, i32 }
|
8 | 7 |
|
9 |
| -define i32 @_Z3fooi4SVal(i32 %i, %struct.SVal* noalias %location) nounwind ssp !dbg !17 { |
| 8 | +define i32 @_Z3fooi4SVal(i32 %i, %struct.SVal* noalias %location) #0 !dbg !4 { |
10 | 9 | entry:
|
11 | 10 | %"alloca point" = bitcast i32 0 to i32
|
12 |
| - call void @llvm.dbg.value(metadata i32 %i, metadata !23, metadata !DIExpression()), !dbg !24 |
13 |
| - call void @llvm.dbg.value(metadata %struct.SVal* %location, metadata !25, metadata !DIExpression()), !dbg !24 |
14 |
| - %0 = icmp ne i32 %i, 0, !dbg !27 |
15 |
| - br i1 %0, label %bb, label %bb1, !dbg !27 |
16 |
| - |
17 |
| -bb: |
18 |
| - %1 = getelementptr inbounds %struct.SVal, %struct.SVal* %location, i32 0, i32 1, !dbg !29 |
19 |
| - %2 = load i32, i32* %1, align 8, !dbg !29 |
20 |
| - %3 = add i32 %2, %i, !dbg !29 |
21 |
| - br label %bb2, !dbg !29 |
22 |
| - |
23 |
| -bb1: |
24 |
| - %4 = getelementptr inbounds %struct.SVal, %struct.SVal* %location, i32 0, i32 1, !dbg !30 |
25 |
| - %5 = load i32, i32* %4, align 8, !dbg !30 |
26 |
| - %6 = sub i32 %5, 1, !dbg !30 |
27 |
| - br label %bb2, !dbg !30 |
28 |
| - |
29 |
| -bb2: |
30 |
| - %.0 = phi i32 [ %3, %bb ], [ %6, %bb1 ] |
31 |
| - br label %return, !dbg !29 |
32 |
| - |
33 |
| -return: |
34 |
| - ret i32 %.0, !dbg !29 |
| 11 | + call void @llvm.dbg.value(metadata i32 %i, metadata !21, metadata !DIExpression()), !dbg !22 |
| 12 | + call void @llvm.dbg.value(metadata %struct.SVal* %location, metadata !23, metadata !DIExpression()), !dbg !22 |
| 13 | + %tmp = icmp ne i32 %i, 0, !dbg !25 |
| 14 | + br i1 %tmp, label %bb, label %bb1, !dbg !25 |
| 15 | + |
| 16 | +bb: ; preds = %entry |
| 17 | + %tmp1 = getelementptr inbounds %struct.SVal, %struct.SVal* %location, i32 0, i32 1, !dbg !27 |
| 18 | + %tmp2 = load i32, i32* %tmp1, align 8, !dbg !27 |
| 19 | + %tmp3 = add i32 %tmp2, %i, !dbg !27 |
| 20 | + br label %bb2, !dbg !27 |
| 21 | + |
| 22 | +bb1: ; preds = %entry |
| 23 | + %tmp4 = getelementptr inbounds %struct.SVal, %struct.SVal* %location, i32 0, i32 1, !dbg !28 |
| 24 | + %tmp5 = load i32, i32* %tmp4, align 8, !dbg !28 |
| 25 | + %tmp6 = sub i32 %tmp5, 1, !dbg !28 |
| 26 | + br label %bb2, !dbg !28 |
| 27 | + |
| 28 | +bb2: ; preds = %bb1, %bb |
| 29 | + %.0 = phi i32 [ %tmp3, %bb ], [ %tmp6, %bb1 ] |
| 30 | + br label %return, !dbg !27 |
| 31 | + |
| 32 | +return: ; preds = %bb2 |
| 33 | + ret i32 %.0, !dbg !27 |
35 | 34 | }
|
36 | 35 |
|
37 |
| -define linkonce_odr void @_ZN4SValC1Ev(%struct.SVal* %this) nounwind ssp align 2 !dbg !16 { |
38 |
| -entry: |
39 |
| - %"alloca point" = bitcast i32 0 to i32 |
40 |
| - call void @llvm.dbg.value(metadata %struct.SVal* %this, metadata !31, metadata !DIExpression()), !dbg !34 |
41 |
| - %0 = getelementptr inbounds %struct.SVal, %struct.SVal* %this, i32 0, i32 0, !dbg !34 |
42 |
| - store i8* null, i8** %0, align 8, !dbg !34 |
43 |
| - %1 = getelementptr inbounds %struct.SVal, %struct.SVal* %this, i32 0, i32 1, !dbg !34 |
44 |
| - store i32 0, i32* %1, align 8, !dbg !34 |
45 |
| - br label %return, !dbg !34 |
46 |
| - |
47 |
| -return: |
48 |
| - ret void, !dbg !35 |
49 |
| -} |
50 |
| - |
51 |
| -declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone |
52 |
| - |
53 |
| -define i32 @main() nounwind ssp !dbg !20 { |
54 |
| -entry: |
55 |
| - %0 = alloca %struct.SVal |
56 |
| - %v = alloca %struct.SVal |
57 |
| - %"alloca point" = bitcast i32 0 to i32 |
58 |
| - call void @llvm.dbg.declare(metadata %struct.SVal* %v, metadata !38, metadata !DIExpression()), !dbg !41 |
59 |
| - call void @_ZN4SValC1Ev(%struct.SVal* %v) nounwind, !dbg !41 |
60 |
| - %1 = getelementptr inbounds %struct.SVal, %struct.SVal* %v, i32 0, i32 1, !dbg !42 |
61 |
| - store i32 1, i32* %1, align 8, !dbg !42 |
62 |
| - %2 = getelementptr inbounds %struct.SVal, %struct.SVal* %0, i32 0, i32 0, !dbg !43 |
63 |
| - %3 = getelementptr inbounds %struct.SVal, %struct.SVal* %v, i32 0, i32 0, !dbg !43 |
64 |
| - %4 = load i8*, i8** %3, align 8, !dbg !43 |
65 |
| - store i8* %4, i8** %2, align 8, !dbg !43 |
66 |
| - %5 = getelementptr inbounds %struct.SVal, %struct.SVal* %0, i32 0, i32 1, !dbg !43 |
67 |
| - %6 = getelementptr inbounds %struct.SVal, %struct.SVal* %v, i32 0, i32 1, !dbg !43 |
68 |
| - %7 = load i32, i32* %6, align 8, !dbg !43 |
69 |
| - store i32 %7, i32* %5, align 8, !dbg !43 |
70 |
| - %8 = call i32 @_Z3fooi4SVal(i32 2, %struct.SVal* noalias %0) nounwind, !dbg !43 |
71 |
| - call void @llvm.dbg.value(metadata i32 %8, metadata !44, metadata !DIExpression()), !dbg !43 |
72 |
| - br label %return, !dbg !45 |
73 |
| - |
74 |
| -return: |
75 |
| - ret i32 0, !dbg !45 |
76 |
| -} |
77 |
| - |
78 |
| -declare void @llvm.dbg.value(metadata, metadata, metadata) nounwind readnone |
79 |
| - |
80 |
| -!llvm.dbg.cu = !{!3} |
81 |
| -!llvm.module.flags = !{!49} |
82 |
| - |
83 |
| -!0 = !DISubprogram(name: "SVal", line: 11, isLocal: false, isDefinition: false, virtualIndex: 6, isOptimized: false, file: !48, scope: !1, type: !14) |
84 |
| -!1 = !DICompositeType(tag: DW_TAG_structure_type, name: "SVal", line: 1, size: 64, align: 64, file: !48, elements: !4) |
85 |
| -!2 = !DIFile(filename: "small.cc", directory: "/Users/manav/R8248330") |
86 |
| -!3 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: FullDebug, file: !48, enums: !47, retainedTypes: !47, globals: !47, imports: !47) |
87 |
| -!4 = !{!5, !7, !0, !9} |
88 |
| -!5 = !DIDerivedType(tag: DW_TAG_member, name: "Data", line: 7, size: 64, align: 64, file: !48, scope: !1, baseType: !6) |
89 |
| -!6 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !48, baseType: null) |
90 |
| -!7 = !DIDerivedType(tag: DW_TAG_member, name: "Kind", line: 8, size: 32, align: 32, offset: 64, file: !48, scope: !1, baseType: !8) |
91 |
| -!8 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) |
92 |
| -!9 = !DISubprogram(name: "~SVal", line: 12, isLocal: false, isDefinition: false, virtualIndex: 6, isOptimized: false, file: !48, scope: !1, type: !10) |
93 |
| -!10 = !DISubroutineType(types: !11) |
94 |
| -!11 = !{null, !12, !13} |
95 |
| -!12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, file: !48, baseType: !1) |
96 |
| -!13 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
97 |
| -!14 = !DISubroutineType(types: !15) |
98 |
| -!15 = !{null, !12} |
99 |
| -!16 = distinct !DISubprogram(name: "SVal", linkageName: "_ZN4SValC1Ev", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !3, file: !48, scope: !1, type: !14) |
100 |
| -!17 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi4SVal", line: 16, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !3, file: !48, scope: !2, type: !18) |
101 |
| -!18 = !DISubroutineType(types: !19) |
102 |
| -!19 = !{!13, !13, !1} |
103 |
| -!20 = distinct !DISubprogram(name: "main", linkageName: "main", line: 23, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !3, file: !48, scope: !2, type: !21) |
104 |
| -!21 = !DISubroutineType(types: !22) |
105 |
| -!22 = !{!13} |
106 |
| -!23 = !DILocalVariable(name: "i", line: 16, arg: 1, scope: !17, file: !2, type: !13) |
107 |
| -!24 = !DILocation(line: 16, scope: !17) |
108 |
| -!25 = !DILocalVariable(name: "location", line: 16, arg: 2, scope: !17, file: !2, type: !26) |
109 |
| -!26 = !DIDerivedType(tag: DW_TAG_reference_type, name: "SVal", size: 32, align: 32, file: !48, scope: !2, baseType: !1) |
110 |
| -!27 = !DILocation(line: 17, scope: !28) |
111 |
| -!28 = distinct !DILexicalBlock(line: 16, column: 0, file: !2, scope: !17) |
112 |
| -!29 = !DILocation(line: 18, scope: !28) |
113 |
| -!30 = !DILocation(line: 20, scope: !28) |
114 |
| -!31 = !DILocalVariable(name: "this", line: 11, arg: 1, scope: !16, file: !2, type: !32) |
115 |
| -!32 = !DIDerivedType(tag: DW_TAG_const_type, flags: DIFlagArtificial, file: !48, scope: !2, baseType: !33) |
116 |
| -!33 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !48, scope: !2, baseType: !1) |
117 |
| -!34 = !DILocation(line: 11, scope: !16) |
118 |
| -!35 = !DILocation(line: 11, scope: !36) |
119 |
| -!36 = distinct !DILexicalBlock(line: 11, column: 0, file: !48, scope: !37) |
120 |
| -!37 = distinct !DILexicalBlock(line: 11, column: 0, file: !48, scope: !16) |
121 |
| -!38 = !DILocalVariable(name: "v", line: 24, scope: !39, file: !2, type: !1) |
122 |
| -!39 = distinct !DILexicalBlock(line: 23, column: 0, file: !48, scope: !40) |
123 |
| -!40 = distinct !DILexicalBlock(line: 23, column: 0, file: !48, scope: !20) |
124 |
| -!41 = !DILocation(line: 24, scope: !39) |
125 |
| -!42 = !DILocation(line: 25, scope: !39) |
126 |
| -!43 = !DILocation(line: 26, scope: !39) |
127 |
| -!44 = !DILocalVariable(name: "k", line: 26, scope: !39, file: !2, type: !13) |
128 |
| -!45 = !DILocation(line: 27, scope: !39) |
129 |
| -!47 = !{} |
130 |
| -!48 = !DIFile(filename: "small.cc", directory: "/Users/manav/R8248330") |
131 |
| -!49 = !{i32 1, !"Debug Info Version", i32 3} |
132 |
| - |
133 |
| -; CHECK: @ DW_OP_breg |
134 |
| - |
| 36 | +declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 |
| 37 | +declare void @llvm.dbg.value(metadata, metadata, metadata) #1 |
| 38 | + |
| 39 | +attributes #0 = { nounwind ssp } |
| 40 | +attributes #1 = { nounwind readnone speculatable willreturn } |
| 41 | + |
| 42 | +!llvm.dbg.cu = !{!0} |
| 43 | +!llvm.module.flags = !{!3} |
| 44 | + |
| 45 | +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !2, imports: !2) |
| 46 | +!1 = !DIFile(filename: "small.cc", directory: "/Users/manav/R8248330") |
| 47 | +!2 = !{} |
| 48 | +!3 = !{i32 1, !"Debug Info Version", i32 3} |
| 49 | +!4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi4SVal", scope: !1, file: !1, line: 16, type: !5, virtualIndex: 6, spFlags: DISPFlagDefinition, unit: !0) |
| 50 | +!5 = !DISubroutineType(types: !6) |
| 51 | +!6 = !{!7, !7, !8} |
| 52 | +!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 53 | +!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "SVal", file: !1, line: 1, size: 64, align: 64, elements: !9) |
| 54 | +!9 = !{!10, !12, !14, !18} |
| 55 | +!10 = !DIDerivedType(tag: DW_TAG_member, name: "Data", scope: !8, file: !1, line: 7, baseType: !11, size: 64, align: 64) |
| 56 | +!11 = !DIDerivedType(tag: DW_TAG_pointer_type, file: !1, baseType: null, size: 64, align: 64) |
| 57 | +!12 = !DIDerivedType(tag: DW_TAG_member, name: "Kind", scope: !8, file: !1, line: 8, baseType: !13, size: 32, align: 32, offset: 64) |
| 58 | +!13 = !DIBasicType(name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) |
| 59 | +!14 = !DISubprogram(name: "SVal", scope: !8, file: !1, line: 11, type: !15, virtualIndex: 6, spFlags: 0) |
| 60 | +!15 = !DISubroutineType(types: !16) |
| 61 | +!16 = !{null, !17} |
| 62 | +!17 = !DIDerivedType(tag: DW_TAG_pointer_type, file: !1, baseType: !8, size: 64, align: 64, flags: DIFlagArtificial) |
| 63 | +!18 = !DISubprogram(name: "~SVal", scope: !8, file: !1, line: 12, type: !19, virtualIndex: 6, spFlags: 0) |
| 64 | +!19 = !DISubroutineType(types: !20) |
| 65 | +!20 = !{null, !17, !7} |
| 66 | +!21 = !DILocalVariable(name: "i", arg: 1, scope: !4, file: !1, line: 16, type: !7) |
| 67 | +!22 = !DILocation(line: 16, scope: !4) |
| 68 | +!23 = !DILocalVariable(name: "location", arg: 2, scope: !4, file: !1, line: 16, type: !24) |
| 69 | +!24 = !DIDerivedType(tag: DW_TAG_reference_type, name: "SVal", scope: !1, file: !1, baseType: !8, size: 32, align: 32) |
| 70 | +!25 = !DILocation(line: 17, scope: !26) |
| 71 | +!26 = distinct !DILexicalBlock(scope: !4, file: !1, line: 16) |
| 72 | +!27 = !DILocation(line: 18, scope: !26) |
| 73 | +!28 = !DILocation(line: 20, scope: !26) |
0 commit comments