1 ; Verify the behavior of the IntelJITEventListener.
2 ; RUN: llvm-jitlistener %s | FileCheck %s
4 ; This test was created using the following file:
6 ; 1: int foo(int a) {
\r
10 ; 5: int bar(int a) {
\r
17 ; 12: int fubar(int a) {
\r
29 ; CHECK: Method load [1]: bar, Size = {{[0-9]+}}
\r
30 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[5,6,7,9]}}
\r
31 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[5,6,7,9]}}
\r
32 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[5,6,7,9]}}
\r
33 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[5,6,7,9]}}
\r
35 ; CHECK: Method load [2]: foo, Size = {{[0-9]+}}
\r
36 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[1,2]}}
\r
37 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[1,2]}}
\r
39 ; CHECK: Method load [3]: fubar, Size = {{[0-9]+}}
\r
40 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
\r
41 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
\r
42 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
\r
43 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
\r
44 ; CHECK: Line info @ {{[0-9]+}}: multiple.c, line {{[12,13,15,17,19]}}
\r
46 ; CHECK: Method unload [1]
\r
47 ; CHECK: Method unload [2]
\r
48 ; CHECK: Method unload [3]
50 ; ModuleID = 'multiple.c'
52 ; Function Attrs: nounwind uwtable
53 define i32 @foo(i32 %a) #0 {
55 %a.addr = alloca i32, align 4
56 store i32 %a, i32* %a.addr, align 4
57 call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !15, metadata !16), !dbg !17
58 %0 = load i32* %a.addr, align 4, !dbg !18
62 ; Function Attrs: nounwind readnone
63 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
65 ; Function Attrs: nounwind uwtable
66 define i32 @bar(i32 %a) #0 {
68 %retval = alloca i32, align 4
69 %a.addr = alloca i32, align 4
70 store i32 %a, i32* %a.addr, align 4
71 call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !20, metadata !16), !dbg !21
72 %0 = load i32* %a.addr, align 4, !dbg !22
73 %cmp = icmp eq i32 %0, 0, !dbg !22
74 br i1 %cmp, label %if.then, label %if.end, !dbg !24
76 if.then: ; preds = %entry
77 store i32 0, i32* %retval, !dbg !25
78 br label %return, !dbg !25
80 if.end: ; preds = %entry
81 %1 = load i32* %a.addr, align 4, !dbg !27
82 %div = sdiv i32 100, %1, !dbg !28
83 store i32 %div, i32* %retval, !dbg !29
84 br label %return, !dbg !29
86 return: ; preds = %if.end, %if.then
87 %2 = load i32* %retval, !dbg !30
91 ; Function Attrs: nounwind uwtable
92 define i32 @fubar(i32 %a) #0 {
94 %retval = alloca i32, align 4
95 %a.addr = alloca i32, align 4
96 store i32 %a, i32* %a.addr, align 4
97 call void @llvm.dbg.declare(metadata i32* %a.addr, metadata !31, metadata !16), !dbg !32
98 %0 = load i32* %a.addr, align 4, !dbg !33
99 switch i32 %0, label %sw.default [
104 sw.bb: ; preds = %entry
105 store i32 10, i32* %retval, !dbg !35
106 br label %return, !dbg !35
108 sw.bb1: ; preds = %entry
109 store i32 20, i32* %retval, !dbg !37
110 br label %return, !dbg !37
112 sw.default: ; preds = %entry
113 store i32 30, i32* %retval, !dbg !38
114 br label %return, !dbg !38
116 return: ; preds = %sw.default, %sw.bb1, %sw.bb
117 %1 = load i32* %retval, !dbg !39
121 attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
122 attributes #1 = { nounwind readnone }
125 !llvm.module.flags = !{!11, !12, !13}
128 !0 = !{!"0x11\0012\00clang version 3.6.0 (trunk)\000\00\000\00\001", !1, !2, !2, !3, !2, !2} ; [ DW_TAG_compile_unit ] [F:\users\akaylor\llvm-s\llvm\test\JitListener/multiple.c] [DW_LANG_C99]
129 !1 = !{!"multiple.c", !"F:\5Cusers\5Cakaylor\5Cllvm-s\5Cllvm\5Ctest\5CJitListener"}
132 !4 = !{!"0x2e\00foo\00foo\00\001\000\001\000\000\00256\000\001", !1, !5, !6, null, i32 (i32)* @foo, null, null, !2} ; [ DW_TAG_subprogram ] [line 1] [def] [foo]
133 !5 = !{!"0x29", !1} ; [ DW_TAG_file_type ] [F:\users\akaylor\llvm-s\llvm\test\JitListener/multiple.c]
134 !6 = !{!"0x15\00\000\000\000\000\000\000", null, null, null, !7, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
136 !8 = !{!"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]
137 !9 = !{!"0x2e\00bar\00bar\00\005\000\001\000\000\00256\000\005", !1, !5, !6, null, i32 (i32)* @bar, null, null, !2} ; [ DW_TAG_subprogram ] [line 5] [def] [bar]
138 !10 = !{!"0x2e\00fubar\00fubar\00\0012\000\001\000\000\00256\000\0012", !1, !5, !6, null, i32 (i32)* @fubar, null, null, !2} ; [ DW_TAG_subprogram ] [line 12] [def] [fubar]
139 !11 = !{i32 2, !"Dwarf Version", i32 4}
140 !12 = !{i32 2, !"Debug Info Version", i32 2}
141 !13 = !{i32 1, !"PIC Level", i32 2}
142 !14 = !{!"clang version 3.6.0 (trunk)"}
143 !15 = !{!"0x101\00a\0016777217\000", !4, !5, !8} ; [ DW_TAG_arg_variable ] [a] [line 1]
144 !16 = !{!"0x102"} ; [ DW_TAG_expression ]
145 !17 = !MDLocation(line: 1, column: 13, scope: !4)
146 !18 = !MDLocation(line: 2, column: 10, scope: !4)
147 !19 = !MDLocation(line: 2, column: 3, scope: !4)
148 !20 = !{!"0x101\00a\0016777221\000", !9, !5, !8} ; [ DW_TAG_arg_variable ] [a] [line 5]
149 !21 = !MDLocation(line: 5, column: 13, scope: !9)
150 !22 = !MDLocation(line: 6, column: 7, scope: !23)
151 !23 = !{!"0xb\006\007\000", !1, !9} ; [ DW_TAG_lexical_block ] [F:\users\akaylor\llvm-s\llvm\test\JitListener/multiple.c]
152 !24 = !MDLocation(line: 6, column: 7, scope: !9)
153 !25 = !MDLocation(line: 7, column: 5, scope: !26)
154 !26 = !{!"0xb\006\0015\001", !1, !23} ; [ DW_TAG_lexical_block ] [F:\users\akaylor\llvm-s\llvm\test\JitListener/multiple.c]
155 !27 = !MDLocation(line: 9, column: 14, scope: !9)
156 !28 = !MDLocation(line: 9, column: 10, scope: !9)
157 !29 = !MDLocation(line: 9, column: 3, scope: !9)
158 !30 = !MDLocation(line: 10, column: 1, scope: !9)
159 !31 = !{!"0x101\00a\0016777228\000", !10, !5, !8} ; [ DW_TAG_arg_variable ] [a] [line 12]
160 !32 = !MDLocation(line: 12, column: 15, scope: !10)
161 !33 = !MDLocation(line: 13, column: 11, scope: !10)
162 !34 = !MDLocation(line: 13, column: 3, scope: !10)
163 !35 = !MDLocation(line: 15, column: 7, scope: !36)
164 !36 = !{!"0xb\0013\0014\002", !1, !10} ; [ DW_TAG_lexical_block ] [F:\users\akaylor\llvm-s\llvm\test\JitListener/multiple.c]
165 !37 = !MDLocation(line: 17, column: 7, scope: !36)
166 !38 = !MDLocation(line: 19, column: 7, scope: !36)
167 !39 = !MDLocation(line: 21, column: 1, scope: !10)