blob: 7272ebe4cd18a810c91d561b9d944c94907b76cb [file] [log] [blame]
NAKAMURA Takumi217ee5b2014-11-04 13:00:48 +00001; RUN: sed -e 's|PATTERN|%/T|g' < %s > %t1
Nick Lewycky5f53ddd2014-06-03 04:25:36 +00002; RUN: opt -insert-gcov-profiling -disable-output < %t1
3; RUN: rm %T/linezero.gcno %t1
Nick Lewycky5f53ddd2014-06-03 04:25:36 +00004
5; This is a crash test.
6
7target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
8target triple = "x86_64-unknown-linux-gnu"
9
10%struct.vector = type { i8 }
11
12; Function Attrs: nounwind
13define i32 @_Z4testv() #0 {
14entry:
15 %retval = alloca i32, align 4
16 %__range = alloca %struct.vector*, align 8
17 %ref.tmp = alloca %struct.vector, align 1
18 %undef.agg.tmp = alloca %struct.vector, align 1
19 %__begin = alloca i8*, align 8
20 %__end = alloca i8*, align 8
21 %spec = alloca i8, align 1
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000022 call void @llvm.dbg.declare(metadata %struct.vector** %__range, metadata !27, metadata !{}), !dbg !30
Nick Lewycky5f53ddd2014-06-03 04:25:36 +000023 br label %0
24
25; <label>:0 ; preds = %entry
26 call void @_Z13TagFieldSpecsv(), !dbg !31
27 store %struct.vector* %ref.tmp, %struct.vector** %__range, align 8, !dbg !31
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000028 call void @llvm.dbg.declare(metadata i8** %__begin, metadata !32, metadata !{}), !dbg !30
Nick Lewycky5f53ddd2014-06-03 04:25:36 +000029 %1 = load %struct.vector** %__range, align 8, !dbg !31
30 %call = call i8* @_ZN6vector5beginEv(%struct.vector* %1), !dbg !31
31 store i8* %call, i8** %__begin, align 8, !dbg !31
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000032 call void @llvm.dbg.declare(metadata i8** %__end, metadata !33, metadata !{}), !dbg !30
Nick Lewycky5f53ddd2014-06-03 04:25:36 +000033 %2 = load %struct.vector** %__range, align 8, !dbg !31
34 %call1 = call i8* @_ZN6vector3endEv(%struct.vector* %2), !dbg !31
35 store i8* %call1, i8** %__end, align 8, !dbg !31
36 br label %for.cond, !dbg !31
37
38for.cond: ; preds = %for.inc, %0
39 %3 = load i8** %__begin, align 8, !dbg !34
40 %4 = load i8** %__end, align 8, !dbg !34
41 %cmp = icmp ne i8* %3, %4, !dbg !34
42 br i1 %cmp, label %for.body, label %for.end, !dbg !34
43
44for.body: ; preds = %for.cond
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000045 call void @llvm.dbg.declare(metadata i8* %spec, metadata !37, metadata !{}), !dbg !31
Nick Lewycky5f53ddd2014-06-03 04:25:36 +000046 %5 = load i8** %__begin, align 8, !dbg !38
47 %6 = load i8* %5, align 1, !dbg !38
48 store i8 %6, i8* %spec, align 1, !dbg !38
49 br label %for.inc, !dbg !38
50
51for.inc: ; preds = %for.body
52 %7 = load i8** %__begin, align 8, !dbg !40
53 %incdec.ptr = getelementptr inbounds i8* %7, i32 1, !dbg !40
54 store i8* %incdec.ptr, i8** %__begin, align 8, !dbg !40
55 br label %for.cond, !dbg !40
56
57for.end: ; preds = %for.cond
58 call void @llvm.trap(), !dbg !42
59 unreachable, !dbg !42
60
61return: ; No predecessors!
62 %8 = load i32* %retval, !dbg !44
63 ret i32 %8, !dbg !44
64}
65
66; Function Attrs: nounwind readnone
Adrian Prantl87b7eb92014-10-01 18:55:02 +000067declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
Nick Lewycky5f53ddd2014-06-03 04:25:36 +000068
69declare void @_Z13TagFieldSpecsv() #2
70
71declare i8* @_ZN6vector5beginEv(%struct.vector*) #2
72
73declare i8* @_ZN6vector3endEv(%struct.vector*) #2
74
75; Function Attrs: noreturn nounwind
76declare void @llvm.trap() #3
77
78; Function Attrs: nounwind
79define void @_Z2f1v() #0 {
80entry:
81 br label %0
82
83; <label>:0 ; preds = %entry
84 ret void, !dbg !45
85}
86
87attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
88attributes #1 = { nounwind readnone }
89attributes #2 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
90attributes #3 = { noreturn nounwind }
91
92!llvm.dbg.cu = !{!0}
93!llvm.module.flags = !{!23, !24}
94!llvm.gcov = !{!25}
95!llvm.ident = !{!26}
96
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000097!0 = !{!"0x11\004\00clang version 3.5.0 (trunk 209871)\000\00\000\00\001", !1, !2, !3, !14, !2, !2} ; [ DW_TAG_compile_unit ] [<stdin>] [DW_LANG_C_plus_plus]
98!1 = !{!"<stdin>", !"PATTERN"}
99!2 = !{}
100!3 = !{!4}
101!4 = !{!"0x13\00vector\0021\008\008\000\000\000", !5, null, null, !6, null, null, !"_ZTS6vector"} ; [ DW_TAG_structure_type ] [vector] [line 21, size 8, align 8, offset 0] [def] [from ]
102!5 = !{!"linezero.cc", !"PATTERN"}
103!6 = !{!7, !13}
104!7 = !{!"0x2e\00begin\00begin\00_ZN6vector5beginEv\0025\000\000\000\006\00256\000\0025", !5, !"_ZTS6vector", !8, null, null, null, i32 0, null} ; [ DW_TAG_subprogram ] [line 25] [begin]
105!8 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !9, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
106!9 = !{!10, !12}
107!10 = !{!"0xf\00\000\0064\0064\000\000", null, null, !11} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from char]
108!11 = !{!"0x24\00char\000\008\008\000\000\006", null, null} ; [ DW_TAG_base_type ] [char] [line 0, size 8, align 8, offset 0, enc DW_ATE_signed_char]
109!12 = !{!"0xf\00\000\0064\0064\000\001088", null, null, !"_ZTS6vector"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from _ZTS6vector]
110!13 = !{!"0x2e\00end\00end\00_ZN6vector3endEv\0026\000\000\000\006\00256\000\0026", !5, !"_ZTS6vector", !8, null, null, null, i32 0, null} ; [ DW_TAG_subprogram ] [line 26] [end]
111!14 = !{!15, !20}
112!15 = !{!"0x2e\00test\00test\00_Z4testv\0050\000\001\000\006\00256\000\0050", !5, !16, !17, null, i32 ()* @_Z4testv, null, null, !2} ; [ DW_TAG_subprogram ] [line 50] [def] [test]
113!16 = !{!"0x29", !5} ; [ DW_TAG_file_type ] [./linezero.cc]
114!17 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !18, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
115!18 = !{!19}
116!19 = !{!"0x24\00int\000\0032\0032\000\000\005", null, null} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
117!20 = !{!"0x2e\00f1\00f1\00_Z2f1v\0054\000\001\000\006\00256\000\0054", !5, !16, !21, null, void ()* @_Z2f1v, null, null, !2} ; [ DW_TAG_subprogram ] [line 54] [def] [f1]
118!21 = !{!"0x15\00\000\000\000\000\000\000", i32 0, null, null, !22, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
119!22 = !{null}
120!23 = !{i32 2, !"Dwarf Version", i32 4}
121!24 = !{i32 2, !"Debug Info Version", i32 2}
122!25 = !{!"PATTERN/linezero.o", !0}
123!26 = !{!"clang version 3.5.0 (trunk 209871)"}
124!27 = !{!"0x100\00__range\000\0064", !28, null, !29} ; [ DW_TAG_auto_variable ] [__range] [line 0]
125!28 = !{!"0xb\0051\000\000", !5, !15} ; [ DW_TAG_lexical_block ] [./linezero.cc]
126!29 = !{!"0x42\00\000\000\000\000\000", null, null, !"_ZTS6vector"} ; [ DW_TAG_rvalue_reference_type ] [line 0, size 0, align 0, offset 0] [from _ZTS6vector]
127!30 = !{i32 0, i32 0, !28, null}
128!31 = !{i32 51, i32 0, !28, null}
129!32 = !{!"0x100\00__begin\000\0064", !28, null, !10} ; [ DW_TAG_auto_variable ] [__begin] [line 0]
130!33 = !{!"0x100\00__end\000\0064", !28, null, !10} ; [ DW_TAG_auto_variable ] [__end] [line 0]
131!34 = !{i32 51, i32 0, !35, null}
132!35 = !{!"0xb\0051\000\005", !5, !36} ; [ DW_TAG_lexical_block ] [./linezero.cc]
133!36 = !{!"0xb\0051\000\001", !5, !28} ; [ DW_TAG_lexical_block ] [./linezero.cc]
134!37 = !{!"0x100\00spec\0051\000", !28, !16, !11} ; [ DW_TAG_auto_variable ] [spec] [line 51]
135!38 = !{i32 51, i32 0, !39, null}
136!39 = !{!"0xb\0051\000\002", !5, !28} ; [ DW_TAG_lexical_block ] [./linezero.cc]
137!40 = !{i32 51, i32 0, !41, null}
138!41 = !{!"0xb\0051\000\004", !5, !28} ; [ DW_TAG_lexical_block ] [./linezero.cc]
139!42 = !{i32 51, i32 0, !43, null}
140!43 = !{!"0xb\0051\000\003", !5, !28} ; [ DW_TAG_lexical_block ] [./linezero.cc]
141!44 = !{i32 52, i32 0, !15, null}
142!45 = !{i32 54, i32 0, !20, null}