llvm.org GIT mirror llvm / 4108bd3
Add testcase for r153705 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153706 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 8 years ago
1 changed file(s) with 59 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llc < %s -O0
1 ;
2 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
3 target triple = "x86_64-apple-macosx10.8.0"
4
5 define i32 @foo(i32* %x) nounwind uwtable ssp {
6 entry:
7 %x.addr = alloca i32*, align 8
8 %saved_stack = alloca i8*
9 %cleanup.dest.slot = alloca i32
10 store i32* %x, i32** %x.addr, align 8
11 call void @llvm.dbg.declare(metadata !{i32** %x.addr}, metadata !14), !dbg !15
12 %0 = load i32** %x.addr, align 8, !dbg !16
13 %1 = load i32* %0, align 4, !dbg !16
14 %2 = zext i32 %1 to i64, !dbg !16
15 %3 = call i8* @llvm.stacksave(), !dbg !16
16 store i8* %3, i8** %saved_stack, !dbg !16
17 %vla = alloca i8, i64 %2, align 16, !dbg !16
18 call void @llvm.dbg.declare(metadata !{i8* %vla}, metadata !18), !dbg !23
19 store i32 1, i32* %cleanup.dest.slot
20 %4 = load i8** %saved_stack, !dbg !24
21 call void @llvm.stackrestore(i8* %4), !dbg !24
22 ret i32 0, !dbg !25
23 }
24
25 declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone
26
27 declare i8* @llvm.stacksave() nounwind
28
29 declare void @llvm.stackrestore(i8*) nounwind
30
31 !llvm.dbg.cu = !{!0}
32
33 !0 = metadata !{i32 786449, i32 0, i32 12, metadata !"20020104-2.c", metadata !"/Volumes/Sandbox/llvm", metadata !"clang version 3.1 (trunk 153698)", i1 true, i1 false, metadata !"", i32 0, metadata !1, metadata !1, metadata !3, metadata !1} ; [ DW_TAG_compile_unit ]
34 !1 = metadata !{metadata !2}
35 !2 = metadata !{i32 0}
36 !3 = metadata !{metadata !4}
37 !4 = metadata !{metadata !5}
38 !5 = metadata !{i32 786478, i32 0, metadata !6, metadata !"foo", metadata !"foo", metadata !"", metadata !6, i32 6, metadata !7, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32 (i32*)* @foo, null, null, metadata !12} ; [ DW_TAG_subprogram ]
39 !6 = metadata !{i32 786473, metadata !"20020104-2.c", metadata !"/Volumes/Sandbox/llvm", null} ; [ DW_TAG_file_type ]
40 !7 = metadata !{i32 786453, i32 0, metadata !"", i32 0, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !8, i32 0, i32 0} ; [ DW_TAG_subroutine_type ]
41 !8 = metadata !{metadata !9, metadata !10}
42 !9 = metadata !{i32 786468, null, metadata !"int", null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ]
43 !10 = metadata !{i32 786447, null, metadata !"", null, i32 0, i64 64, i64 64, i64 0, i32 0, metadata !11} ; [ DW_TAG_pointer_type ]
44 !11 = metadata !{i32 786470, null, metadata !"", null, i32 0, i64 0, i64 0, i64 0, i32 0, metadata !9} ; [ DW_TAG_const_type ]
45 !12 = metadata !{metadata !13}
46 !13 = metadata !{i32 786468} ; [ DW_TAG_base_type ]
47 !14 = metadata !{i32 786689, metadata !5, metadata !"x", metadata !6, i32 16777221, metadata !10, i32 0, i32 0} ; [ DW_TAG_arg_variable ]
48 !15 = metadata !{i32 5, i32 21, metadata !5, null}
49 !16 = metadata !{i32 7, i32 13, metadata !17, null}
50 !17 = metadata !{i32 786443, metadata !5, i32 6, i32 1, metadata !6, i32 0} ; [ DW_TAG_lexical_block ]
51 !18 = metadata !{i32 786688, metadata !17, metadata !"a", metadata !6, i32 7, metadata !19, i32 0, i32 0} ; [ DW_TAG_auto_variable ]
52 !19 = metadata !{i32 786433, null, metadata !"", null, i32 0, i64 0, i64 8, i32 0, i32 0, metadata !20, metadata !21, i32 0, i32 0} ; [ DW_TAG_array_type ]
53 !20 = metadata !{i32 786468, null, metadata !"char", null, i32 0, i64 8, i64 8, i64 0, i32 0, i32 6} ; [ DW_TAG_base_type ]
54 !21 = metadata !{metadata !22}
55 !22 = metadata !{i32 786465, i64 1, i64 0} ; [ DW_TAG_subrange_type ]
56 !23 = metadata !{i32 7, i32 8, metadata !17, null}
57 !24 = metadata !{i32 9, i32 1, metadata !17, null}
58 !25 = metadata !{i32 8, i32 3, metadata !17, null}