llvm.org GIT mirror llvm / a15a133
Add a testcase for basic bugpointing in the presence of metadata. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111955 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 9 years ago
1 changed file(s) with 34 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: bugpoint -load %llvmlibsdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -silence-passes > /dev/null
1 ; RUN: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s
2
3 ; Bugpoint should keep the call's metadata attached to the call.
4
5 ; CHECK: call void @foo(), !dbg !0, !attach !2
6 ; CHECK: !0 = metadata !{i32 104, i32 105, metadata !1, metadata !1}
7 ; CHECK: !1 = metadata !{i32 0, i32 0, i32 0, metadata !"source.c", metadata !"/dir", metadata !"me", i1 true, i1 false, metadata !"", i32 0}
8 ; CHECK: !2 = metadata !{metadata !"the call to foo"}
9
10 %rust_task = type {}
11 define void @test(i32* %a, i8* %b) {
12 %s = mul i8 22, 9, !attach !0, !dbg !10
13 store i8 %s, i8* %b, !attach !1, !dbg !11
14 call void @foo(), !attach !2, !dbg !12
15 store i32 7, i32* %a, !attach !3, !dbg !13
16 %t = add i32 0, 5, !attach !4, !dbg !14
17 ret void
18 }
19
20 declare void @foo()
21
22 !0 = metadata !{metadata !"boring"}
23 !1 = metadata !{metadata !"uninteresting"}
24 !2 = metadata !{metadata !"the call to foo"}
25 !3 = metadata !{metadata !"noise"}
26 !4 = metadata !{metadata !"filler"}
27
28 !9 = metadata !{i32 0, i32 0, i32 0, metadata !"source.c", metadata !"/dir", metadata !"me", i1 true, i1 false, metadata !"", i32 0}
29 !10 = metadata !{i32 100, i32 101, metadata !9, metadata !9}
30 !11 = metadata !{i32 102, i32 103, metadata !9, metadata !9}
31 !12 = metadata !{i32 104, i32 105, metadata !9, metadata !9}
32 !13 = metadata !{i32 106, i32 107, metadata !9, metadata !9}
33 !14 = metadata !{i32 108, i32 109, metadata !9, metadata !9}