1*9880d681SAndroid Build Coastguard Worker; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -silence-passes -disable-namedmd-remove > /dev/null 2*9880d681SAndroid Build Coastguard Worker; RUN: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s 3*9880d681SAndroid Build Coastguard Worker; REQUIRES: loadable_module 4*9880d681SAndroid Build Coastguard Worker 5*9880d681SAndroid Build Coastguard Worker; Bugpoint should keep the call's metadata attached to the call. 6*9880d681SAndroid Build Coastguard Worker 7*9880d681SAndroid Build Coastguard Worker; CHECK: call void @foo(), !dbg ![[LOC:[0-9]+]], !attach ![[CALL:[0-9]+]] 8*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: ![[LOC]] = !DILocation(line: 104, column: 105, scope: ![[SCOPE:[0-9]+]]) 9*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: ![[SCOPE]] = distinct !DISubprogram(name: "test",{{.*}}file: ![[FILE:[0-9]+]] 10*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: ![[FILE]] = !DIFile(filename: "source.c", directory: "/dir") 11*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: ![[CALL]] = !{!"the call to foo"} 12*9880d681SAndroid Build Coastguard Worker 13*9880d681SAndroid Build Coastguard Worker%rust_task = type {} 14*9880d681SAndroid Build Coastguard Workerdefine void @test(i32* %a, i8* %b) { 15*9880d681SAndroid Build Coastguard Worker %s = mul i8 22, 9, !attach !0, !dbg !10 16*9880d681SAndroid Build Coastguard Worker store i8 %s, i8* %b, !attach !1, !dbg !11 17*9880d681SAndroid Build Coastguard Worker call void @foo(), !attach !2, !dbg !12 18*9880d681SAndroid Build Coastguard Worker store i32 7, i32* %a, !attach !3, !dbg !13 19*9880d681SAndroid Build Coastguard Worker %t = add i32 0, 5, !attach !4, !dbg !14 20*9880d681SAndroid Build Coastguard Worker ret void 21*9880d681SAndroid Build Coastguard Worker} 22*9880d681SAndroid Build Coastguard Worker 23*9880d681SAndroid Build Coastguard Workerdeclare void @foo() 24*9880d681SAndroid Build Coastguard Worker 25*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!17} 26*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!8} 27*9880d681SAndroid Build Coastguard Worker 28*9880d681SAndroid Build Coastguard Worker!0 = !{!"boring"} 29*9880d681SAndroid Build Coastguard Worker!1 = !{!"uninteresting"} 30*9880d681SAndroid Build Coastguard Worker!2 = !{!"the call to foo"} 31*9880d681SAndroid Build Coastguard Worker!3 = !{!"noise"} 32*9880d681SAndroid Build Coastguard Worker!4 = !{!"filler"} 33*9880d681SAndroid Build Coastguard Worker 34*9880d681SAndroid Build Coastguard Worker!8 = distinct !DICompileUnit(language: DW_LANG_C99, file: !15) 35*9880d681SAndroid Build Coastguard Worker!9 = distinct !DISubprogram(name: "test", file: !15, unit: !8) 36*9880d681SAndroid Build Coastguard Worker!10 = !DILocation(line: 100, column: 101, scope: !9) 37*9880d681SAndroid Build Coastguard Worker!11 = !DILocation(line: 102, column: 103, scope: !9) 38*9880d681SAndroid Build Coastguard Worker!12 = !DILocation(line: 104, column: 105, scope: !9) 39*9880d681SAndroid Build Coastguard Worker!13 = !DILocation(line: 106, column: 107, scope: !9) 40*9880d681SAndroid Build Coastguard Worker!14 = !DILocation(line: 108, column: 109, scope: !9) 41*9880d681SAndroid Build Coastguard Worker!15 = !DIFile(filename: "source.c", directory: "/dir") 42*9880d681SAndroid Build Coastguard Worker!16 = !{} 43*9880d681SAndroid Build Coastguard Worker!17 = !{i32 1, !"Debug Info Version", i32 3} 44