[PATCH] D71957: [llvm-size] print a blank line between archieve members when using sysv format

Xuanda Yang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 00:54:10 PST 2020


TH3CHARLie marked an inline comment as done.
TH3CHARLie added inline comments.


================
Comment at: llvm/test/tools/llvm-size/archive.test:50
 # SYSV-3-EMPTY:
+# SYSV-3-EMPTY:
+# SYSV-3-EMPTY:
----------------
MaskRay wrote:
> TH3CHARLie wrote:
> > MaskRay wrote:
> > > GNU size prints 2 blank lines.
> > I believe this is necessary, see `radix.test`'s case 4-6
> `--format=sysv` prints exactly two blank lines between two blocks. Your patch currently prints 3.
> 
> After you fix this, you may need to provide `git commit --amend --author "what-is-your-name <what-is at your-email>"`
As you can tell from the patch, there was a `SYSV-3-EMPTY` in the testcase before this patch. The original code prints no new lines between blocks and to match the newly added 2 newlines, 2 corresponding `SYSV-3-EMPTY` is needed here.

If we remove a `SYSV-3-EMPTY` here, error will be generated:
```bash
/home/yxd/llvm-project/llvm/test/tools/llvm-size/archive.test:52:16: error: SYSV-3-NEXT: is not on the line after the previous match
# SYSV-3-NEXT: archive.test.tmp1 (ex [[ARCHIVE2]]):
               ^
<stdin>:10:1: note: 'next' match was here
archive.test.tmp1 (ex /home/yxd/llvm-project/build/test/tools/llvm-size/Output/archive.test.tmp2.a):
^
<stdin>:8:1: note: previous match ended here

^
<stdin>:9:1: note: non-matching line after previous match is here

```

Although I'm not sure about why there was a `SYSV-3-EMPTY` here before adding any newlines, it is required here to add the two `SYSV-3-EMPTY` to pass the test. BTW, I have also verified with custom testcases.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71957/new/

https://reviews.llvm.org/D71957





More information about the llvm-commits mailing list