about summary refs log tree commit diff
path: root/tests/ui/linkage-attr
AgeCommit message (Collapse)AuthorLines
2025-09-26Ignore more failing ui tests for GCC backendGuillaume Gomez-0/+2
2025-09-10tidy: check that error messages don't start with a capitalized letterSasha Pourcelot-2/+2
2025-09-03don't uppercase error messagesSasha Pourcelot-2/+2
a more general version of https://github.com/rust-lang/rust/pull/146080. after a bit of hacking in [`fluent.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_fluent_macro/src/fluent.rs), i discovered that i'm not the only one that is bad at following guidelines :sweat_smile:. this pr lowercases the first letter of all the error messages in the codebase. (i did not change things that are traditionally uppercased such as _MIR_, _ABI_ or _C_) i think it's reasonable to run a `@bors try` so all the test suite is checked, as i cannot run some of the tests on my machine. i double checked (and replaced manually) all the old error messages, but better be safe than sorry. in the future i will try to add a check in `x test tidy` that errors if an error message starts with an uppercase letter.
2025-08-27Changes to the uitestsJonathan Brouwer-36/+111
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-08-21refactor target checking, move out of context.rs and rename MaybeWarn to PolicyJana Dönszelmann-3/+3
2025-08-19bless tests with new lint messagesKarol Zwolak-1/+1
2025-08-14Update uitestsJonathan Brouwer-6/+12
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-08-13Port the `#[linkage]` attribute to the new attribute systemSasha Pourcelot-5/+24
2025-08-11Add more docs to templates for attrs with incorrect argumentsEsteban Küber-2/+18
2025-08-07Prevent name collisions with internal implementation detailsbjorn3-68/+0
The implementation of the linkage attribute inside extern blocks defines symbols starting with _rust_extern_with_linkage_. If someone tries to also define this symbol you will get a symbol conflict or even an ICE. By adding an unpredictable component to the symbol name, this becomes less of an issue.
2025-08-02Rollup merge of #144703 - daltenty:daltenty/extern-weak, r=NoratriebSamuel Tardieu-0/+1
[test][AIX] ignore extern_weak linkage test The AIX linkage model doesn't support ELF-style extern_weak semantics, so just skip this test, like other platforms that don't have it.
2025-07-30[test][AIX] ignore extern_weak linkage testDavid Tenty-0/+1
The AIX linkage model doesn't support ELF style extern_weak semantic, so just skip this test, like other platforms that don't have it.
2025-07-29Verify llvm-needs-components are not empty and match the --target valueDaniel Paoliello-2/+2
2025-07-25Rollup merge of #143979 - dpaoliello:arm64ectest, r=petrochenkovMatthias Krüger-1/+1
Test fixes for Arm64EC Windows * `tests/ui/cfg/conditional-compile-arch.rs` needs an Arm64EC case. * `tests/ui/runtime/backtrace-debuginfo.rs` should skip Arm64EC as it suffers from the same truncated backtraces as Arm64 Windows. * `tests/ui/linkage-attr/incompatible-flavor.rs` is a general issue: it assumes that the Rust compiler is always built with the x86 target enabled in the backend, but I only enabled AArch64 when building locally to speed up the LLVM compilation.
2025-07-24generate elf symbol version in raw-dylibusamoi-0/+137
2025-07-13Fixes for Arm64ECDaniel Paoliello-1/+1
2025-07-13Port `#[link_ordinal]` to the new attribute parsing infrastructure.Anne Stijns-32/+45
2025-06-30Rollup merge of #143195 - Kivooeo:tf17, r=tgross35dianqk-0/+23
`tests/ui`: A New Order [17/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@tgross35`
2025-06-30Rollup merge of #143118 - Kivooeo:tf15, r=tgross35dianqk-0/+41
`tests/ui`: A New Order [15/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@jieyouxu`
2025-06-30cleaned up some testsKivooeo-3/+13
2025-06-30cleaned up some testsKivooeo-1/+2
2025-06-29moved testsKivooeo-0/+13
2025-06-28Move some UI tests to more apropriate directoriesTrevor Gross-0/+40
Prepare for rework done in the rest of [PR143118]. [PR143118]: https://www.github.com/rust-lang/rust/pull/143118 Co-authored-by: Kivooeo <Kivooeo123@gmail.com>
2025-06-23tests: Update raw-dylib unsupported ABI testJubilee Young-2/+2
2025-06-12tests: Convert linkage-attr test to cross-compiling and blessJubilee Young-21/+12
2025-06-08try to manually bless windows test outputRalf Jung-2/+37
2025-04-10tests: use specific-purpose `needs-crate-type` over `ignore-$target` directivesJieyou Xu-2/+1
Not all existing tests are converted, I only updated ones that I can easily find via directive comments.
2025-04-04Rollup merge of #139322 - Kobzol:run-make-lld-refactor, r=jieyouxuMatthias Krüger-17/+0
Add helper function for checking LLD usage to `run-make-support` Extracted out of https://github.com/rust-lang/rust/pull/138645, should be a simple refactoring. r? ``@jieyouxu``
2025-04-03Move `link-self-contained-consistency` test to a more reasonable locationJakub Beránek-17/+0
2025-04-03compiletest: Require `//~` annotations even if `error-pattern` is specifiedVadim Petrochenkov-4/+13
2025-03-25compiletest: Support matching on diagnostics without a spanVadim Petrochenkov-0/+9
2025-02-26Support raw-dylib link kind on ELFNoratrieb-0/+556
raw-dylib is a link kind that allows rustc to link against a library without having any library files present. This currently only exists on Windows. rustc will take all the symbols from raw-dylib link blocks and put them in an import library, where they can then be resolved by the linker. While import libraries don't exist on ELF, it would still be convenient to have this same functionality. Not having the libraries present at build-time can be convenient for several reasons, especially cross-compilation. With raw-dylib, code linking against a library can be cross-compiled without needing to have these libraries available on the build machine. If the libc crate makes use of this, it would allow cross-compilation without having any libc available on the build machine. This is not yet possible with this implementation, at least against libc's like glibc that use symbol versioning. The raw-dylib kind could be extended with support for symbol versioning in the future. This implementation is very experimental and I have not tested it very well. I have tested it for a toy example and the lz4-sys crate, where it was able to successfully link a binary despite not having a corresponding library at build-time.
2025-02-07Remove Linkage::Privatebjorn3-3/+0
This is the same as Linkage::Internal except that it doesn't emit any symbol. Some backends may not support it and it isn't all that useful anyway.
2025-02-03Enable more tests on WindowsBen Kimock-2/+2
2024-12-07Move more tests into `tests/ui/link-native-libs`Zalathar-293/+0
2024-12-01Auto merge of #133499 - nikic:no-backend-verify, r=Mark-Simulacrumbors-0/+1
Respect verify-llvm-ir option in the backend We are currently unconditionally verifying the LLVM IR in the backend (twice), ignoring the value of the verify-llvm-ir option. This has substantial compile-time impact for debug builds.
2024-11-29Fix tests that rely on LLVM IR verificationNikita Popov-0/+1
Pass -Z verify-llvm-ir to tests that rely on it, to make sure they pass regardless of the value of verify-llvm-ir in config.toml. Also remove the 109681.rs test, because it is a duplicat of common-linkage-non-zero-init.rs.
2024-11-26tests: remove `//@ pretty-expanded` usages许杰友 Jieyou Xu (Joe)-3/+0
Done with ```bash sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs ``` and ``` sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs ```
2024-10-27port `tests/ui/linkage-attr/framework` to run-makejyn-40/+0
this makes it much easier to understand test failures. before: ``` diff of stderr: 1 error: linking with `LINKER` failed: exit status: 1 2 | - ld: Undefined symbols: 4 _CFRunLoopGetTypeID, referenced from: 5 clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` after: ``` === HAYSTACK === error: linking with `cc` failed: exit status: 1 | = note: use `--verbose` to show all linker arguments = note: Undefined symbols for architecture arm64: "_CFRunLoopGetTypeID", referenced from: main::main::hbb553f5dda62d3ea in main.main.d17f5fbe6225cf88-cgu.0.rcgu.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) error: aborting due to 1 previous error === NEEDLE === _CFRunLoopGetTypeID\.?, referenced from: thread 'main' panicked at /Users/jyn/git/rust-lang/rust/tests/run-make/linkage-attr-framework/rmake.rs:22:10: needle was not found in haystack ``` this also fixes a failure related to missing whitespace; we don't actually care about whitespace in this test.
2024-09-13Update tests for hidden references to mutable staticObei Sideg-1/+3
2024-06-29unreferenced-used-static: run test everywhereRalf Jung-3/+4
2024-06-28add non-regression test for issue 127052Rémy Rakic-0/+9
2024-06-03Allow static mut definitions with #[linkage]bjorn3-8/+17
Unlike static declarations with #[linkage], for definitions rustc doesn't rewrite it to add an extra indirection.
2024-05-28Make more of the test suite run on Mac CatalystMads Marquart-2/+75
This adds the `only-apple`/`ignore-apple` compiletest directive, and uses that basically everywhere instead of `only-macos`/`ignore-macos`. Some of the updates in `run-make` are a bit redundant, as they use `ignore-cross-compile` and won't run on iOS - but using Apple in these is still more correct, so I've made that change anyhow.
2024-05-13Only allow immutable statics with #[linkage]bjorn3-0/+25
2024-04-10Add test for linking to UIKitMads Marquart-0/+25
2024-04-07Move testsCaio-0/+44
2024-04-06Relax framework linking testMads Marquart-2/+4
This test was introduced in #118644, but was over-specified in that it assumed the path of the linker was always `cc`.
2024-03-18Add test for Apple's -weak_framework linker argumentMads Marquart-0/+38
2024-03-11Update test directives for `wasm32-wasip1`Alex Crichton-0/+1
* The WASI targets deal with the `main` symbol a bit differently than native so some `codegen` and `assembly` tests have been ignored. * All `ignore-emscripten` directives have been updated to `ignore-wasm32` to be more clear that all wasm targets are ignored and it's not just Emscripten. * Most `ignore-wasm32-bare` directives are now gone. * Some ignore directives for wasm were switched to `needs-unwind` instead. * Many `ignore-wasm32*` directives are removed as the tests work with WASI as opposed to `wasm32-unknown-unknown`.