[llvm] [llvm-objcopy] Add --gap-fill and --pad-to options (PR #65815)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 19 01:35:21 PDT 2023


================
@@ -1,46 +1,56 @@
-# RUN: yaml2obj %s > %t
-
-# baseline, no padding
-# RUN: llvm-objcopy -O binary %t %t.bin
+# RUN: yaml2obj %s -o %t
 
 # RUN: not llvm-objcopy --pad-to=1 %t 2>&1 | FileCheck %s --check-prefix=NOT-BINARY
 # NOT-BINARY: error: '--pad-to' is only supported for binary output
 
 # RUN: not llvm-objcopy -O binary --pad-to= %t 2>&1 | FileCheck %s --check-prefix=BAD-FORMAT
-# BAD-FORMAT: bad address for --pad-to:
+# BAD-FORMAT: error: --pad-to: bad number:
 
 # RUN: not llvm-objcopy -O binary --pad-to=x %t 2>&1 | FileCheck %s --check-prefix=BAD-INPUT
-# BAD-INPUT: bad address for --pad-to: x
+# BAD-INPUT: error: --pad-to: bad number: x
 
 # RUN: not llvm-objcopy -O binary --pad-to=0x1G %t 2>&1 | FileCheck %s --check-prefix=BAD-INPUT2
-# BAD-INPUT2: bad address for --pad-to: 0x1G
+# BAD-INPUT2: error: --pad-to: bad number: 0x1G
+
+# RUN: not llvm-objcopy -O binary --pad-to=ff %t 2>&1 | FileCheck %s --check-prefix=BAD-INPUT3
+# BAD-INPUT3: error: --pad-to: bad number: ff
 
 # RUN: not llvm-objcopy -O binary --pad-to=0x112233445566778899 %t 2>&1 | FileCheck %s --check-prefix=BAD-NUMBER
-# BAD-NUMBER: bad address for --pad-to: 0x112233445566778899
+# BAD-NUMBER: error: --pad-to: bad number: 0x112233445566778899
 
-# Pad to a address smaller than the binary size
+## Save the baseline, not padded output.
+# RUN: llvm-objcopy -O binary %t %t.bin
+
+## Pad to a address smaller than the binary size.
----------------
jh7370 wrote:

```suggestion
## Pad to an address smaller than the binary size.
```
Nit.

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


More information about the llvm-commits mailing list