; Test that llvm-reduce can remove uninteresting function arguments from function definitions as well as their calls.
;
-; RUN: rm -rf %t
-; RUN: mkdir %t
-; get the python path from lit
-; RUN: echo "#!" %python > %t/test.py
-; then include the rest of the test script
-; RUN: cat %p/Inputs/remove-args.py >> %t/test.py
-; RUN: chmod +x %t/test.py
-
-; RUN: llvm-reduce --test %t/test.py %s -o %t/out.ll
-; RUN: cat %t/out.ll | FileCheck -implicit-check-not=uninteresting %s
-; REQUIRES: shell
+; RUN: llvm-reduce --test %python --test-arg %p/Inputs/remove-args.py %s -o %t
+; RUN: cat %t | FileCheck -implicit-check-not=uninteresting %s
; CHECK: @interesting(i32 %interesting)
define void @interesting(i32 %uninteresting1, i32 %interesting, i32 %uninteresting2) {
; Test that llvm-reduce can remove uninteresting functions as well as
; their InstCalls.
;
-; RUN: rm -rf %t
-; RUN: mkdir %t
-; get the python path from lit
-; RUN: echo "#!" %python > %t/test.py
-; then include the rest of the test script
-; RUN: cat %p/Inputs/remove-funcs.py >> %t/test.py
-; RUN: chmod +x %t/test.py
-
-; RUN: llvm-reduce --test %t/test.py %s -o %t/out.ll
-; RUN: cat %t/out.ll | FileCheck -implicit-check-not=uninteresting %s
-; REQUIRES: shell
+; RUN: llvm-reduce --test %python --test-arg %p/Inputs/remove-funcs.py %s -o %t
+; RUN: cat %t | FileCheck -implicit-check-not=uninteresting %s
define i32 @uninteresting1() {
entry:
; Test that llvm-reduce can remove uninteresting Global Variables as well as
; their direct uses (which in turn are replaced with 'undef').
;
-; RUN: rm -rf %t
-; RUN: mkdir %t
-; get the python path from lit
-; RUN: echo "#!" %python > %t/test.py
-; then include the rest of the test script
-; RUN: cat %p/Inputs/remove-global-vars.py >> %t/test.py
-; RUN: chmod +x %t/test.py
-
-; RUN: llvm-reduce --test %t/test.py %s -o %t/out.ll
-; RUN: cat %t/out.ll | FileCheck -implicit-check-not=uninteresting %s
-; REQUIRES: shell
+; RUN: llvm-reduce --test %python --test-arg %p/Inputs/remove-global-vars.py %s -o %t
+; RUN: cat %t | FileCheck -implicit-check-not=uninteresting %s
; CHECK: @interesting = global
@interesting = global i32 0, align 4
; Test that llvm-reduce can remove uninteresting metadata from an IR file.
; The Metadata pass erases named & unnamed metadata nodes.
;
-; RUN: rm -rf %t
-; RUN: mkdir %t
-; get the python path from lit
-; RUN: echo "#!" %python > %t/test.py
-; then include the rest of the test script
-; RUN: cat %p/Inputs/remove-metadata.py >> %t/test.py
-; RUN: chmod +x %t/test.py
-
-; RUN: llvm-reduce --test %t/test.py %s -o %t/out.ll
-; RUN: cat %t/out.ll | FileCheck -implicit-check-not=! %s
-; REQUIRES: shell
+; RUN: llvm-reduce --test %python --test-arg %p/Inputs/remove-metadata.py %s -o %t
+; RUN: cat %t | FileCheck -implicit-check-not=! %s
@global = global i32 0, !dbg !0
int TestRunner::run(StringRef Filename) {
std::vector<StringRef> ProgramArgs;
ProgramArgs.push_back(TestName);
- ProgramArgs.push_back(Filename);
- for (auto Arg : TestArgs)
- ProgramArgs.push_back(Arg.c_str());
+ for (const auto &Arg : TestArgs)
+ ProgramArgs.push_back(Arg);
+
+ ProgramArgs.push_back(Filename);
- Optional<StringRef> Redirects[3]; // STDIN, STDOUT, STDERR
std::string ErrMsg;
- int Result =
- sys::ExecuteAndWait(TestName, ProgramArgs, None, Redirects,
- /*SecondsToWait=*/0, /*MemoryLimit=*/0, &ErrMsg);
+ int Result = sys::ExecuteAndWait(
+ TestName, ProgramArgs, /*Env=*/None, /*Redirects=*/None,
+ /*SecondsToWait=*/0, /*MemoryLimit=*/0, &ErrMsg);
if (Result < 0) {
Error E = make_error<StringError>("Error running interesting-ness test: " +