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: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c77b243d059c207f3a4a93e0aff12a49e1f77a46;p=llvm 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371772 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Reduce/remove-args.ll b/test/Reduce/remove-args.ll index 634ce93d7d8..4823f751923 100644 --- a/test/Reduce/remove-args.ll +++ b/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/test/Reduce/remove-funcs.ll b/test/Reduce/remove-funcs.ll index d48e5734dd8..6b3c86bea87 100644 --- a/test/Reduce/remove-funcs.ll +++ b/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/test/Reduce/remove-global-vars.ll b/test/Reduce/remove-global-vars.ll index 8f13c3d4a4f..900774762c1 100644 --- a/test/Reduce/remove-global-vars.ll +++ b/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/test/Reduce/remove-metadata.ll b/test/Reduce/remove-metadata.ll index 94df1d8da2e..b887737f3b3 100644 --- a/test/Reduce/remove-metadata.ll +++ b/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