[all-commits] [llvm/llvm-project] 754b94: [lld] Support RUN_LLD_MAIN_TWICE for the ELF port ...

Fangrui Song via All-commits all-commits at lists.llvm.org
Mon Jan 27 10:05:18 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 754b94638e8935e1c1ed6121e0037fdae8b3c63c
      https://github.com/llvm/llvm-project/commit/754b94638e8935e1c1ed6121e0037fdae8b3c63c
  Author: Fangrui Song <i at maskray.me>
  Date:   2025-01-27 (Mon, 27 Jan 2025)

  Changed paths:
    M lld/test/ELF/archive-thin-missing-member.s
    M lld/test/ELF/arm-thumb-thunk-v6m-xo.s
    M lld/test/ELF/arm-thunk-section-too-large.s
    M lld/test/ELF/arm-thunk-toolargesection.s
    M lld/test/ELF/arm-v5-reloc-error.s
    M lld/test/ELF/bad-archive.s
    M lld/test/ELF/fatlto/fatlto.invalid.s
    M lld/test/ELF/invalid-cie-reference.s
    M lld/test/ELF/invalid/comdat-broken.test
    M lld/test/ELF/invalid/data-encoding.test
    M lld/test/ELF/invalid/dynamic-section-broken.test
    M lld/test/ELF/invalid/invalid-elf.test
    M lld/test/ELF/invalid/invalid-file-class.test
    M lld/test/ELF/invalid/sht-group-wrong-section.test
    M lld/test/ELF/invalid/sht-group.test
    M lld/test/ELF/invalid/symtab-sh-info.s
    M lld/test/ELF/invalid/verneed-shared.test
    M lld/test/ELF/lto/bitcode-nodatalayout.ll
    M lld/test/ELF/lto/bitcode-wrapper.ll
    M lld/test/ELF/unsupported-emachine.test
    M lld/test/lit.cfg.py

  Log Message:
  -----------
  [lld] Support RUN_LLD_MAIN_TWICE for the ELF port (#124441)

This enables the LLD_IN_TEST=2 testing mode for
```
path/to/llvm-lit -sv --param RUN_LLD_MAIN_TWICE=1 lld/test/ELF
```

When `Fatal` is called, `RunSafely` will return false.
For the first invocation in LLD_IN_TEST=2 mode, `inTestOutputDisabled`
is true and lld will not write to stdout/stderr, making many tests fail.
(This essentially discourages `Fatal` calls in the source code.)

Add XFAIL: main-run-twice to these tests similar to
https://reviews.llvm.org/D112898 for Mach-O

```
comment="This test intentionally checks for fatal errors, and fatal errors aren't supported for testing when main is run twice."
xargs </tmp/0 sed -Ei "1s/(;|#|\/\/) REQUIRES: .*/\0\n\1 "$comment"\n\1 XFAIL: main-run-twice/;t;1s/^/# "$comment"\n# XFAIL: main-run-twice\n/"
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list