rust/tests/run-make
Miguel Ojeda 74b8d324eb Support .comment section like GCC/Clang (!llvm.ident)
Both GCC and Clang write by default a `.comment` section with compiler
information:

```txt
$ gcc -c -xc /dev/null && readelf -p '.comment' null.o

String dump of section '.comment':
  [     1]  GCC: (GNU) 11.2.0

$ clang -c -xc /dev/null && readelf -p '.comment' null.o

String dump of section '.comment':
  [     1]  clang version 14.0.1 (https://github.com/llvm/llvm-project.git c62053979489ccb002efe411c3af059addcb5d7d)
```

They also implement the `-Qn` flag to avoid doing so:

```txt
$ gcc -Qn -c -xc /dev/null && readelf -p '.comment' null.o
readelf: Warning: Section '.comment' was not dumped because it does not exist!

$ clang -Qn -c -xc /dev/null && readelf -p '.comment' null.o
readelf: Warning: Section '.comment' was not dumped because it does not exist!
```

So far, `rustc` only does it for WebAssembly targets and only
when debug info is enabled:

```txt
$ echo 'fn main(){}' | rustc --target=wasm32-unknown-unknown --emit=llvm-ir -Cdebuginfo=2 - && grep llvm.ident rust_out.ll
!llvm.ident = !{!27}
```

In the RFC part of this PR it was decided to always add
the information, which gets us closer to other popular compilers.
An opt-out flag like GCC and Clang may be added later on if deemed
necessary.

Implementation-wise, this covers both `ModuleLlvm::new()` and
`ModuleLlvm::new_metadata()` cases by moving the addition to
`context::create_module` and adds a few test cases.

ThinLTO also sees the `llvm.ident` named metadata duplicated (in
temporary outputs), so this deduplicates it like it is done for
`wasm.custom_sections`. The tests also check this duplication does
not take place.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-07-21 22:01:50 +02:00
..
a-b-a-linker-guard
alloc-no-oom-handling
alloc-no-rc
alloc-no-sync
allocator-shim-circular-deps Fix linker failures when #[global_allocator] is used in a dependency 2023-06-19 17:31:54 +00:00
allow-non-lint-warnings-cmdline
allow-warnings-cmdline-stability
archive-duplicate-names
arguments-non-c-like-enum
atomic-lock-free
bare-outfile
branch-protection-check-IBT Add GNU Property Note 2023-05-05 18:32:20 +00:00
c-dynamic-dylib
c-dynamic-rlib
c-link-to-rust-dylib
c-link-to-rust-staticlib
c-link-to-rust-va-list-fn
c-static-dylib
c-static-rlib
c-unwind-abi-catch-lib-panic Add needs-unwind annotations to tests that need stack unwinding 2023-05-02 12:07:55 +00:00
c-unwind-abi-catch-panic Add needs-unwind annotations to tests that need stack unwinding 2023-05-02 12:07:55 +00:00
cat-and-grep-sanity-check
cdylib
cdylib-dylib-linkage
cdylib-fewer-symbols
codegen-options-parsing
comment-section Support .comment section like GCC/Clang (!llvm.ident) 2023-07-21 22:01:50 +02:00
compile-stdin
compiler-lookup-paths
compiler-lookup-paths-2
compiler-rt-works-on-mingw
const_fn_mir Bless tests 2023-06-23 18:36:25 +01:00
const-prop-lint Do not rely on exact error code. 2023-04-21 16:14:44 +00:00
core-no-fp-fmt-parse
core-no-oom-handling tests: add test for warning-free builds of core under no_global_oom_handling 2023-04-24 01:56:37 +02:00
coverage-llvmir Remove the old coverage-reports and coverage directories 2023-06-28 11:09:19 +10:00
crate-data-smoke
crate-hash-rustc-version
crate-name-priority
cross-lang-lto
cross-lang-lto-clang
cross-lang-lto-pgo-smoketest
cross-lang-lto-upstream-rlibs
CURRENT_RUSTC_VERSION Only depend on CFG_VERSION in rustc_interface 2023-05-17 23:54:21 -05:00
debug-assertions Add needs-unwind annotations to tests that need stack unwinding 2023-05-02 12:07:55 +00:00
debugger-visualizer-dep-info Add/improve tests for debugger_visualizer change detection. 2023-05-17 11:39:11 +02:00
dep-graph
dep-info
dep-info-doesnt-run-much
dep-info-spaces
doctests-keep-binaries
dump-ice-to-disk Add run-make test for ICE dump 2023-07-19 14:10:13 +00:00
dump-mono-stats
duplicate-output-flavors
dylib-chain
emit
emit-named-files
emit-path-unhashed
emit-shared-files
emit-stack-sizes
emit-to-stdout fix 2023-06-06 17:54:34 -04:00
env-dep-info
error-found-staticlib-instead-crate
error-writing-dependencies
exit-code On nightly, dump ICE backtraces to disk 2023-07-19 14:10:07 +00:00
export-executable-symbols
extern-diff-internal-name
extern-flag-disambiguates
extern-flag-fun
extern-flag-pathless Verify that all crate sources are in sync 2023-07-19 14:47:05 +00:00
extern-flag-rename-transitive
extern-fn-explicit-align extern-fn-explicit-align test: remove unnecessary derives 2023-07-14 16:22:29 -04:00
extern-fn-generic
extern-fn-mangle
extern-fn-reachable
extern-fn-struct-passing-abi i686-windows: pass arguments with requested alignment > 4 indirectly 2023-07-10 19:19:38 -04:00
extern-fn-with-extern-types
extern-fn-with-packed-struct
extern-fn-with-union
extern-multiple-copies
extern-multiple-copies2
extern-overrides-distribution
extra-filename-with-temp-outputs
fmt-write-bloat
forced-unwind-terminate-pof Add test for unwinding past terminating POF 2023-05-07 12:38:47 +01:00
foreign-double-unwind Add needs-unwind annotations to tests that need stack unwinding 2023-05-02 12:07:55 +00:00
foreign-exceptions Add needs-unwind annotations to tests that need stack unwinding 2023-05-02 12:07:55 +00:00
foreign-rust-exceptions Add needs-unwind annotations to tests that need stack unwinding 2023-05-02 12:07:55 +00:00
fpic
glibc-staticlib-args
hir-tree
inaccessible-temp-dir run-make test: using single quotes to not trigger the shell 2023-04-28 16:11:45 +02:00
include_bytes_deps
incr-add-rust-src-component
incr-foreign-head-span
incr-prev-body-beyond-eof
incremental-debugger-visualizer Fix run-make/inrcemental-debugger-visualizer test for macOS. 2023-05-19 11:02:16 +02:00
incremental-session-fail
inline-always-many-cgu
interdependent-c-libraries
intrinsic-unreachable
invalid-library
invalid-so
invalid-staticlib
issue64319
issue-7349
issue-10971-temps-dir
issue-11908
issue-14500
issue-14698
issue-15460
issue-18943
issue-20626
issue-22131
issue-24445
issue-25581
issue-26006
issue-26092
issue-28595
issue-28766
issue-30063
issue-33329
issue-35164
issue-36710
issue-37839
issue-37893
issue-38237
issue-40535
issue-46239
issue-47384
issue-47551
issue-51671 Revert "Remove #[alloc_error_handler] from the compiler and library" 2023-04-25 00:08:35 +02:00
issue-53964
issue-64153
issue-68794-textrel-on-minimal-lib
issue-69368 Revert "Remove #[alloc_error_handler] from the compiler and library" 2023-04-25 00:08:35 +02:00
issue-71519
issue-83045 Fix symbol conflict diagnostic mistakenly being shown instead of missing crate diagnostic 2023-05-23 07:37:16 +00:00
issue-83112-incr-test-moved-file
issue-84395-lto-embed-bitcode
issue-85019-moved-src-dir
issue-85401-static-mir
issue-85441
issue-88756-default-output
issue-96498
issue-97463-abi-param-passing
issue-107094 Make commit-date pattern more specific in test for issue 107094 2023-04-17 18:53:52 +02:00
issue-109934-lto-debuginfo debuginfo: split method declaration and definition 2023-05-03 15:52:31 -07:00
jobserver-error Temporarily disable the jobserver-error test 2023-04-15 07:40:19 -07:00
libs-through-symlinks
libtest-json Add needs-unwind annotations to tests that need stack unwinding 2023-05-02 12:07:55 +00:00
libtest-junit Apply changes to fix python linting errors 2023-06-16 20:56:01 -04:00
libtest-thread-limit
link-arg
link-args-order
link-cfg
link-dedup
link-path-order
linkage-attr-on-static
llvm-ident Support .comment section like GCC/Clang (!llvm.ident) 2023-07-21 22:01:50 +02:00
llvm-outputs
long-linker-command-lines
long-linker-command-lines-cmd-exe
longjmp-across-rust
ls-metadata
lto-dylib-dep
lto-empty
lto-no-link-whole-rlib
lto-readonly-lib
lto-smoke
lto-smoke-c
macos-deployment-target
macos-fat-archive
manual-crate-name
manual-link
many-crates-but-no-match
metadata-flag-frobs-symbols
min-global-align
mingw-export-call-convention
mismatching-target-triples
missing-crate-dependency
mixing-deps
mixing-formats
mixing-libs Verify that all crate sources are in sync 2023-07-19 14:47:05 +00:00
msvc-opt-minsize
multiple-emits
native-link-modifier-bundle
native-link-modifier-verbatim-linker
native-link-modifier-verbatim-rustc
native-link-modifier-whole-archive
no-alloc-shim Ignore test on MSVC for now 2023-05-11 14:47:56 +00:00
no-builtins-attribute Add the no-builtins attribute to functions when no_builtins is applied at the crate level. 2023-07-18 22:15:47 +08:00
no-builtins-lto
no-cdylib-as-rdylib Verify that all crate sources are in sync 2023-07-19 14:47:05 +00:00
no-duplicate-libs
no-input-file
no-intermediate-extras
obey-crate-type-flag
optimization-remarks-dir Add rustc option to output LLVM optimization remarks to YAML files 2023-07-02 13:41:36 +02:00
output-filename-conflicts-with-directory
output-filename-overwrites-input
output-type-permutations
output-with-hyphens
override-aliased-flags
overwrite-input
panic-abort-eh_frame Remove wrongly emitted .eh_frame in -Cpanic=abort 2023-06-07 21:03:51 +01:00
panic-impl-transitive
pass-linker-flags
pass-linker-flags-from-dep
pass-non-c-like-enum-to-c
pgo-branch-weights
pgo-gen
pgo-gen-lto
pgo-gen-no-imp-symbols
pgo-indirect-call-promotion
pgo-use
pointer-auth-link-with-c pointer-auth-link-with-c: Fix cross compilation. 2023-04-21 18:38:17 -07:00
prefer-dylib
prefer-rlib
pretty-print-to-file
print-calling-conventions
print-cfg Add test of --print KIND=PATH 2023-07-20 11:04:30 -07:00
print-native-static-libs De-duplicate consecutive libs when printing native-static-libs 2023-07-12 20:04:30 +02:00
print-target-list
profile
prune-link-args
raw-dylib-alt-calling-convention Stablize raw-dylib, link_ordinal and -Cdlltool 2023-04-18 11:01:07 -07:00
raw-dylib-c Stablize raw-dylib, link_ordinal and -Cdlltool 2023-04-18 11:01:07 -07:00
raw-dylib-cross-compilation Stablize raw-dylib, link_ordinal and -Cdlltool 2023-04-18 11:01:07 -07:00
raw-dylib-custom-dlltool Stablize raw-dylib, link_ordinal and -Cdlltool 2023-04-18 11:01:07 -07:00
raw-dylib-import-name-type Stablize raw-dylib, link_ordinal and -Cdlltool 2023-04-18 11:01:07 -07:00
raw-dylib-inline-cross-dylib Stablize raw-dylib, link_ordinal and -Cdlltool 2023-04-18 11:01:07 -07:00
raw-dylib-link-ordinal Stablize raw-dylib, link_ordinal and -Cdlltool 2023-04-18 11:01:07 -07:00
raw-dylib-stdcall-ordinal Stablize raw-dylib, link_ordinal and -Cdlltool 2023-04-18 11:01:07 -07:00
redundant-libs
relocation-model
relro-levels
remap-path-prefix
remap-path-prefix-dwarf
repr128-dwarf
reproducible-build
reproducible-build-2
resolve-rename
return-non-c-like-enum
return-non-c-like-enum-from-c
rlib-chain
rlib-format-packed-bundled-libs
rlib-format-packed-bundled-libs-2
rlib-format-packed-bundled-libs-3
rmeta-preferred Rewrite rmeta-rpass test to work with the new check for all crate sources being in sync 2023-07-19 14:47:06 +00:00
rust-lld add end-to-end test 2023-06-30 21:13:24 +00:00
rustc-macro-dep-files
rustdoc-determinism
rustdoc-error-lines
rustdoc-io-error
rustdoc-map-file Apply changes to fix python linting errors 2023-06-16 20:56:01 -04:00
rustdoc-output-path
rustdoc-scrape-examples-invalid-expr
rustdoc-scrape-examples-macros
rustdoc-scrape-examples-multiple
rustdoc-scrape-examples-ordering
rustdoc-scrape-examples-remap
rustdoc-scrape-examples-test
rustdoc-scrape-examples-whitespace
rustdoc-shared-flags
rustdoc-target-spec-json-path
rustdoc-themes Replace id attribute with name for <meta> tag 2023-06-27 23:22:44 +02:00
rustdoc-verify-output-files
rustdoc-with-out-dir-option
rustdoc-with-output-option
rustdoc-with-short-out-dir-option
sanitizer-cdylib-link
sanitizer-dylib-link
sanitizer-staticlib-link
separate-link
separate-link-fail
sepcomp-cci-copies
sepcomp-inlining
sepcomp-separate
share-generics-dylib
short-ice On nightly, dump ICE backtraces to disk 2023-07-19 14:10:07 +00:00
simd-ffi
simple-dylib
simple-rlib
split-debuginfo
stable-symbol-names
static-dylib-by-default
static-extern-type
static-pie
static-unwinding Add needs-unwind annotations to tests that need stack unwinding 2023-05-02 12:07:55 +00:00
staticlib-blank-lib
staticlib-dylib-linkage Ignore test when cross compiling 2023-04-27 18:22:06 +00:00
std-core-cycle
stdin-non-utf8
suspicious-library
symbol-visibility
symbols-include-type-name
symlinked-extern
symlinked-libraries
symlinked-rlib
sysroot-crates-are-unstable Apply changes to fix python linting errors 2023-06-16 20:56:01 -04:00
target-cpu-native
target-specs Make sure to include default en-US ftl resources for rustc_error crate 2023-06-23 17:22:07 +00:00
target-without-atomic-cas
test-benches Add needs-unwind annotations to tests that need stack unwinding 2023-05-02 12:07:55 +00:00
test-harness
thumb-none-cortex-m
thumb-none-qemu
track-path-dep-info
track-pgo-dep-info
translation Fix tests/run-make-translation when download-rustc is enabled 2023-04-19 00:39:20 -05:00
type-mismatch-same-crate-name
unstable-flag-required
use-extern-for-plugins
use-suggestions-rust-2018
used
used-cdylib-macos
valid-print-requests Add deployment-target --print flag for Apple targets 2023-05-05 01:22:17 -05:00
version
volatile-intrinsics
wasm-abi
wasm-custom-section
wasm-custom-sections-opt
wasm-exceptions-nostd add run-make test for wasm-exceptions 2023-07-01 20:24:15 +02:00
wasm-export-all-symbols
wasm-import-module
wasm-panic-small
wasm-spurious-import
wasm-stringify-ints-small
wasm-symbols-different-module
wasm-symbols-not-exported Revert "Remove #[alloc_error_handler] from the compiler and library" 2023-04-25 00:08:35 +02:00
wasm-symbols-not-imported
weird-output-filenames
windows-binary-no-external-deps
windows-spawn
windows-subsystem
x86_64-fortanix-unknown-sgx-lvi Verify that (almost) all ret instructions have been replaced 2023-06-05 17:33:26 +02:00
git_clone_sha1.sh
tools.mk