1
1
; Test remark output for stack-frame-layout
2
2
3
+ ; ensure basic output works
4
+ ; RUN: llc -mcpu=corei7 -O1 -pass-remarks-analysis=stack-frame-layout < %s 2>&1 >/dev/null | FileCheck %s
5
+
6
+ ; check additional slots are displayed when stack is not optimized
7
+ ; RUN: llc -mcpu=corei7 -O0 -pass-remarks-analysis=stack-frame-layout < %s 2>&1 >/dev/null | FileCheck %s --check-prefix=NO_COLORING
8
+
3
9
; check more complex cases
4
10
; RUN: llc %s -pass-remarks-analysis=stack-frame-layout -o /dev/null --march=x86 -mcpu=i386 2>&1 | FileCheck %s --check-prefix=BOTH --check-prefix=DEBUG
5
11
6
12
; check output without debug info
7
13
; RUN: opt %s -passes=strip -S | llc -pass-remarks-analysis=stack-frame-layout -o /dev/null --march=x86 -mcpu=i386 2>&1 | FileCheck %s --check-prefix=BOTH --check-prefix=STRIPPED
8
14
9
- target triple = "i386 -unknown-linux-gnu"
15
+ target triple = "x86_64 -unknown-linux-gnu"
10
16
11
17
@.str = private unnamed_addr constant [4 x i8 ] c "%s\0A\00 " , align 1
12
18
declare i32 @printf (ptr , ...)
13
19
20
+ ; CHECK: Function: stackSizeWarning
21
+ ; CHECK: Offset: [SP-88], Type: Variable, Align: 16, Size: 80
22
+ ; CHECK: buffer @ frame-diags.c:30
23
+ ; NO_COLORING: Offset: [SP-168], Type: Variable, Align: 16, Size: 80
24
+ ; CHECK: buffer2 @ frame-diags.c:33
25
+ define void @stackSizeWarning () {
26
+ entry:
27
+ %buffer = alloca [80 x i8 ], align 16
28
+ %buffer2 = alloca [80 x i8 ], align 16
29
+ call void @llvm.dbg.declare (metadata ptr %buffer , metadata !25 , metadata !DIExpression ()), !dbg !39
30
+ call void @llvm.dbg.declare (metadata ptr %buffer2 , metadata !31 , metadata !DIExpression ()), !dbg !40
31
+ ret void
32
+ }
33
+
14
34
; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn
15
35
declare void @llvm.dbg.declare (metadata , metadata , metadata ) #0
16
36
@@ -188,7 +208,7 @@ entry:
188
208
}
189
209
190
210
; uselistorder directives
191
- uselistorder ptr @llvm.dbg.declare , { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 17 , 16 }
211
+ uselistorder ptr @llvm.dbg.declare , { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 19 , 18 }
192
212
193
213
attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn }
194
214
attributes #1 = { "frame-pointer" ="all" }
@@ -202,19 +222,19 @@ attributes #2 = { ssp "stack-protector-buffer-size"="5" "frame-pointer"="all" }
202
222
!2 = distinct !DICompileUnit (language: DW_LANG_C99, file: !3 , isOptimized: false , runtimeVersion: 0 , emissionKind: FullDebug, retainedTypes: !4 , splitDebugInlining: false , nameTableKind: None)
203
223
!3 = !DIFile (filename: "dot.c" , directory: "" )
204
224
!4 = !{!5 , !6 , !10 , !13 }
205
- !5 = !DIDerivedType (tag: DW_TAG_pointer_type, baseType: null , size: 32 )
206
- !6 = !DIDerivedType (tag: DW_TAG_pointer_type, baseType: !7 , size: 32 )
207
- !7 = distinct !DICompositeType (tag: DW_TAG_structure_type, name: "Array" , file: !3 , line: 3 , size: 64 , elements: !8 )
225
+ !5 = !DIDerivedType (tag: DW_TAG_pointer_type, baseType: null , size: 64 )
226
+ !6 = !DIDerivedType (tag: DW_TAG_pointer_type, baseType: !7 , size: 64 )
227
+ !7 = distinct !DICompositeType (tag: DW_TAG_structure_type, name: "Array" , file: !3 , line: 3 , size: 128 , elements: !8 )
208
228
!8 = !{!9 , !12 }
209
- !9 = !DIDerivedType (tag: DW_TAG_member, name: "data" , scope: !7 , file: !3 , line: 4 , baseType: !10 , size: 32 )
210
- !10 = !DIDerivedType (tag: DW_TAG_pointer_type, baseType: !11 , size: 32 )
229
+ !9 = !DIDerivedType (tag: DW_TAG_member, name: "data" , scope: !7 , file: !3 , line: 4 , baseType: !10 , size: 64 )
230
+ !10 = !DIDerivedType (tag: DW_TAG_pointer_type, baseType: !11 , size: 64 )
211
231
!11 = !DIBasicType (name: "int" , size: 32 , encoding: DW_ATE_signed)
212
- !12 = !DIDerivedType (tag: DW_TAG_member, name: "size" , scope: !7 , file: !3 , line: 5 , baseType: !11 , size: 32 , offset: 32 )
213
- !13 = !DIDerivedType (tag: DW_TAG_pointer_type, baseType: !14 , size: 32 )
214
- !14 = distinct !DICompositeType (tag: DW_TAG_structure_type, name: "Result" , file: !3 , line: 8 , size: 64 , elements: !15 )
232
+ !12 = !DIDerivedType (tag: DW_TAG_member, name: "size" , scope: !7 , file: !3 , line: 5 , baseType: !11 , size: 32 , offset: 64 )
233
+ !13 = !DIDerivedType (tag: DW_TAG_pointer_type, baseType: !14 , size: 64 )
234
+ !14 = distinct !DICompositeType (tag: DW_TAG_structure_type, name: "Result" , file: !3 , line: 8 , size: 128 , elements: !15 )
215
235
!15 = !{!16 , !17 }
216
- !16 = !DIDerivedType (tag: DW_TAG_member, name: "data" , scope: !14 , file: !3 , line: 9 , baseType: !6 , size: 32 )
217
- !17 = !DIDerivedType (tag: DW_TAG_member, name: "sum" , scope: !14 , file: !3 , line: 10 , baseType: !11 , size: 32 , offset: 32 )
236
+ !16 = !DIDerivedType (tag: DW_TAG_member, name: "data" , scope: !14 , file: !3 , line: 9 , baseType: !6 , size: 64 )
237
+ !17 = !DIDerivedType (tag: DW_TAG_member, name: "sum" , scope: !14 , file: !3 , line: 10 , baseType: !11 , size: 32 , offset: 64 )
218
238
!18 = !{i32 7 , !"Dwarf Version" , i32 5 }
219
239
!19 = !{i32 2 , !"Debug Info Version" , i32 3 }
220
240
!20 = !{i32 1 , !"wchar_size" , i32 4 }
0 commit comments