[lld] [lld][test] Fix unintentional write to a non-writeable dir (PR #150436)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 24 08:10:41 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lld

Author: Jordan Rupprecht (rupprecht)

<details>
<summary>Changes</summary>

The test added in #<!-- -->147970 fails trying to write `a.out` when run in a non-writeable directory. I believe the intent was to write to /dev/null as the output, but `-o` was omitted, so it's actually linking *in* /dev/null and writing to `a.out`.

---
Full diff: https://github.com/llvm/llvm-project/pull/150436.diff


1 Files Affected:

- (modified) lld/test/ELF/aarch64-build-attributes-malformed.s (+1-1) 


``````````diff
diff --git a/lld/test/ELF/aarch64-build-attributes-malformed.s b/lld/test/ELF/aarch64-build-attributes-malformed.s
index f40da1ab7e8a1..c8a0fd62b20aa 100644
--- a/lld/test/ELF/aarch64-build-attributes-malformed.s
+++ b/lld/test/ELF/aarch64-build-attributes-malformed.s
@@ -1,7 +1,7 @@
 # REQUIRES: aarch64
 
 # RUN: llvm-mc -triple=aarch64 -filetype=obj %s -o %t.o
-# RUN: ld.lld %t.o /dev/null 2>&1 | FileCheck %s
+# RUN: ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s
 
 # CHECK: (.ARM.attributes): unexpected end of data at offset 0x3f while reading [0x3d, 0x41)
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/150436


More information about the llvm-commits mailing list