From: Tim Shen Date: Thu, 12 Sep 2019 21:03:49 +0000 (+0000) Subject: Fix llvm-reduce tests so that they don't assume the source code is X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=396d0e1635b535397aecfc542320c98c3119b1b1;p=platform%2Fupstream%2Fllvm.git Fix llvm-reduce tests so that they don't assume the source code is writable. Instead of copying over the original file permissions, just create a new file and add the executable bit. llvm-svn: 371772 --- diff --git a/llvm/test/Reduce/remove-args.ll b/llvm/test/Reduce/remove-args.ll index 634ce93..4823f75 100644 --- a/llvm/test/Reduce/remove-args.ll +++ b/llvm/test/Reduce/remove-args.ll @@ -2,12 +2,11 @@ ; ; RUN: rm -rf %t ; RUN: mkdir %t -; copy the test file to preserve executable bit -; RUN: cp %p/Inputs/remove-args.py %t/test.py ; 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 diff --git a/llvm/test/Reduce/remove-funcs.ll b/llvm/test/Reduce/remove-funcs.ll index d48e573..6b3c86b 100644 --- a/llvm/test/Reduce/remove-funcs.ll +++ b/llvm/test/Reduce/remove-funcs.ll @@ -3,12 +3,11 @@ ; ; RUN: rm -rf %t ; RUN: mkdir %t -; copy the test file to preserve executable bit -; RUN: cp %p/Inputs/remove-funcs.py %t/test.py ; 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 diff --git a/llvm/test/Reduce/remove-global-vars.ll b/llvm/test/Reduce/remove-global-vars.ll index 8f13c3d..9007747 100644 --- a/llvm/test/Reduce/remove-global-vars.ll +++ b/llvm/test/Reduce/remove-global-vars.ll @@ -3,12 +3,11 @@ ; ; RUN: rm -rf %t ; RUN: mkdir %t -; copy the test file to preserve executable bit -; RUN: cp %p/Inputs/remove-global-vars.py %t/test.py ; 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 diff --git a/llvm/test/Reduce/remove-metadata.ll b/llvm/test/Reduce/remove-metadata.ll index 94df1d8..b887737 100644 --- a/llvm/test/Reduce/remove-metadata.ll +++ b/llvm/test/Reduce/remove-metadata.ll @@ -3,12 +3,11 @@ ; ; RUN: rm -rf %t ; RUN: mkdir %t -; copy the test file to preserve executable bit -; RUN: cp %p/Inputs/remove-metadata.py %t/test.py ; 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