hokein updated this revision to Diff 534438. hokein added a comment. Herald added subscribers: MaskRay, emaste. Herald added a reviewer: alexander-shaposhnikov.
add lit tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D153652/new/ https://reviews.llvm.org/D153652 Files: llvm/lib/Support/raw_ostream.cpp llvm/test/tools/llvm-dwarfutil/ELF/X86/file-permissions.test llvm/test/tools/llvm-objcopy/ELF/file-permissions.test Index: llvm/test/tools/llvm-objcopy/ELF/file-permissions.test =================================================================== --- /dev/null +++ llvm/test/tools/llvm-objcopy/ELF/file-permissions.test @@ -0,0 +1,5 @@ +# RUN: cp %p/Inputs/dwarf.dwo %t-exe.dwo +# RUN: chmod a+x %t-exe.dwo +# RUN: llvm-objcopy --split-dwo=%t2 %t-exe.dwo %t3 +# Verify the output file preserve the executable bit from the input file. +# RUN: test -x %t3 Index: llvm/test/tools/llvm-dwarfutil/ELF/X86/file-permissions.test =================================================================== --- /dev/null +++ llvm/test/tools/llvm-dwarfutil/ELF/X86/file-permissions.test @@ -0,0 +1,9 @@ +# RUN: yaml2obj %p/Inputs/common.yaml -o %t.o +# RUN: chmod a+x %t.o + +# Verify that the output file preserves the executable bit from the input file. +# RUN: llvm-dwarfutil --no-garbage-collection %t.o %t1 +# RUN: test -x %t1 + +# RUN: llvm-dwarfutil --garbage-collection --separate-debug-file %t.o %t2 +# RUN: test -x %t2.debug Index: llvm/lib/Support/raw_ostream.cpp =================================================================== --- llvm/lib/Support/raw_ostream.cpp +++ llvm/lib/Support/raw_ostream.cpp @@ -1007,7 +1007,7 @@ return Write(Out); } - unsigned Mode = sys::fs::all_read | sys::fs::all_write | sys::fs::all_exe; + unsigned Mode = sys::fs::all_read | sys::fs::all_write; Expected<sys::fs::TempFile> Temp = sys::fs::TempFile::create(OutputFileName + ".temp-stream-%%%%%%", Mode); if (!Temp)
Index: llvm/test/tools/llvm-objcopy/ELF/file-permissions.test =================================================================== --- /dev/null +++ llvm/test/tools/llvm-objcopy/ELF/file-permissions.test @@ -0,0 +1,5 @@ +# RUN: cp %p/Inputs/dwarf.dwo %t-exe.dwo +# RUN: chmod a+x %t-exe.dwo +# RUN: llvm-objcopy --split-dwo=%t2 %t-exe.dwo %t3 +# Verify the output file preserve the executable bit from the input file. +# RUN: test -x %t3 Index: llvm/test/tools/llvm-dwarfutil/ELF/X86/file-permissions.test =================================================================== --- /dev/null +++ llvm/test/tools/llvm-dwarfutil/ELF/X86/file-permissions.test @@ -0,0 +1,9 @@ +# RUN: yaml2obj %p/Inputs/common.yaml -o %t.o +# RUN: chmod a+x %t.o + +# Verify that the output file preserves the executable bit from the input file. +# RUN: llvm-dwarfutil --no-garbage-collection %t.o %t1 +# RUN: test -x %t1 + +# RUN: llvm-dwarfutil --garbage-collection --separate-debug-file %t.o %t2 +# RUN: test -x %t2.debug Index: llvm/lib/Support/raw_ostream.cpp =================================================================== --- llvm/lib/Support/raw_ostream.cpp +++ llvm/lib/Support/raw_ostream.cpp @@ -1007,7 +1007,7 @@ return Write(Out); } - unsigned Mode = sys::fs::all_read | sys::fs::all_write | sys::fs::all_exe; + unsigned Mode = sys::fs::all_read | sys::fs::all_write; Expected<sys::fs::TempFile> Temp = sys::fs::TempFile::create(OutputFileName + ".temp-stream-%%%%%%", Mode); if (!Temp)
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits