[bugpoint] Find 'opt', etc., in bugpoint directory
Summary:
When bugpoint attempts to find the other executables it needs to run,
such as `opt` or `clang`, it tries searching the user's PATH. However,
in many cases, the 'bugpoint' executable is part of an LLVM build, and
the 'opt' executable it's looking for is in that same directory.
Many LLVM tools handle this case by using the `Paths` parameter of
`llvm::sys::findProgramByName`, passing the parent path of the currently
running executable. Do this same thing for bugpoint. However, to
preserve the current behavior exactly, first search the user's PATH,
and then search for 'opt' in the directory containing 'bugpoint'.
Test Plan:
`check-llvm`. Many of the existing bugpoint tests no longer need to use the
`--opt-command` option as a result of these changes.
Reviewers: MatzeB, silvas, davide
Reviewed By: MatzeB, davide
Subscribers: davide, llvm-commits
Differential Revision: https://reviews.llvm.org/D54884
llvm-svn: 348734
2018-12-10 01:56:13 +01:00
|
|
|
; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crash-too-many-cus -silence-passes -disable-strip-debuginfo > /dev/null
|
2015-11-06 01:12:50 +01:00
|
|
|
; RUN: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s
|
|
|
|
; RUN-DISABLE: bugpoint -disable-namedmd-remove -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crash-too-many-cus -silence-passes > /dev/null
|
|
|
|
; RUN-DISABLE: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s
|
|
|
|
; REQUIRES: loadable_module
|
|
|
|
|
|
|
|
; CHECK: !llvm.dbg.cu = !{![[FIRST:[0-9]+]], ![[SECOND:[0-9]+]]}
|
|
|
|
; CHECK-DISABLE: !llvm.dbg.cu = !{![[FIRST:[0-9]+]], ![[SECOND:[0-9]+]],
|
|
|
|
; CHECK-DISABLE-SAME: ![[THIRD:[0-9]+]], ![[FOURTH:[0-9]+]], ![[FIFTH:[0-9]+]]}
|
|
|
|
!llvm.dbg.cu = !{!0, !1, !2, !3, !4, !5}
|
|
|
|
; CHECK-NOT: !named
|
|
|
|
; CHECK-DISABLE: !named
|
|
|
|
!named = !{!0, !1, !2, !3, !4, !5}
|
|
|
|
; CHECK: !llvm.module.flags = !{![[DIVERSION:[0-9]+]]}
|
|
|
|
!llvm.module.flags = !{!6, !7}
|
|
|
|
|
|
|
|
; CHECK-DAG: ![[FIRST]] = distinct !DICompileUnit(language: DW_LANG_Julia,
|
|
|
|
; CHECK-DAG: ![[SECOND]] = distinct !DICompileUnit(language: DW_LANG_Julia,
|
|
|
|
; CHECK-DAG: ![[DIVERSION]] = !{i32 2, !"Debug Info Version", i32 3}
|
|
|
|
; CHECK-DAG: !DIFile(filename: "a", directory: "b")
|
|
|
|
|
|
|
|
; 4 nodes survive. Due to renumbering !4 should not exist
|
|
|
|
; CHECK-NOT: !4
|
|
|
|
|
|
|
|
!0 = distinct !DICompileUnit(language: DW_LANG_Julia,
|
|
|
|
file: !8)
|
|
|
|
!1 = distinct !DICompileUnit(language: DW_LANG_Julia,
|
|
|
|
file: !8)
|
|
|
|
!2 = distinct !DICompileUnit(language: DW_LANG_Julia,
|
|
|
|
file: !8)
|
|
|
|
!3 = distinct !DICompileUnit(language: DW_LANG_Julia,
|
|
|
|
file: !8)
|
|
|
|
!4 = distinct !DICompileUnit(language: DW_LANG_Julia,
|
|
|
|
file: !8)
|
|
|
|
!5 = distinct !DICompileUnit(language: DW_LANG_Julia,
|
|
|
|
file: !8)
|
|
|
|
!6 = !{i32 2, !"Dwarf Version", i32 2}
|
|
|
|
!7 = !{i32 2, !"Debug Info Version", i32 3}
|
|
|
|
!8 = !DIFile(filename: "a", directory: "b")
|