about summary refs log tree commit diff
path: root/src/test/ui/abi
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-2728/+0
2022-11-08Rollup merge of #101381 - Urgau:target-mixup-homogenous-floats, r=AmanieuManish Goregaokar-0/+192
Test that target feature mix up with homogeneous floats is sound This pull-request adds a test in `src/test/abi/` that test that target feature mix up with homogeneous floats is sound. This is basically is ripoff of [src/test/ui/simd/target-feature-mixup.rs](https://github.com/rust-lang/rust/blob/47d1cdb0bcac8e417071ce1929d261efe2399ae2/src/test/ui/simd/target-feature-mixup.rs) but for floats and without `#[repr(simd)]`. *Extracted from https://github.com/rust-lang/rust/pull/97559 since I don't yet know what to do with that PR.*
2022-11-05Adjust diagnostics, bless testsMichael Goulet-22/+28
2022-11-01Test that target feature mix up with homogeneous floats is soundLoïc BRANSTETT-0/+192
This is basically is ripoff of src/test/ui/simd/target-feature-mixup.rs but for floats and without #[repr(simd)]
2022-10-17Stabilize asm_symAmanieu d'Antras-8/+18
2022-10-02Auto merge of #102305 - flba-eb:remove_exclude_list, r=Mark-Simulacrumbors-30/+8
Get rid of exclude-list for Windows-only tests Main purpose of this change is to get rid of a quite long (and growing) list of excluded targets, while this test should only be useful on Windows (as far as I understand it). The `// only-windows` header seams to implement exactly what we need here. I don't know why there are some whitespace changes, but `x.py fmt` and `.git/hooks/pre-push` are happy.
2022-10-01bless ui testsMaybe Waffle-3/+3
2022-09-26Enable inline stack probes on PowerPC and SystemZJosh Stone-8/+23
2022-09-26Get rid of long exclude-list for Windows-only testsFlorian Bartels-30/+8
2022-09-22Improve the help message for an invalid calling conventionkhyperia-0/+17
2022-09-21Adding ignore fuchsia tests for signal casesAndrew Pollack-0/+3
2022-09-16fix typo in comment noted by bjorn3.Felix S. Klock II-1/+1
2022-08-05Ignore test on wasmWesley Wiser-0/+1
2022-07-06experiment: trying to encode the end-to-end test as a ui test via ↵Felix S. Klock II-0/+38
rust_test_helpers. This instance is almost certainly insufficient because we need to force optimization flags for both the C and Rust sides of the code. but lets find out for sure.
2022-07-02Fix rust-call ICE in mir-inlinerMichael Goulet-0/+3
2022-03-27Remove duplicated test filesCaio-55/+0
2022-03-21Add needs-asm-support directive to tests where necessarybjorn3-0/+1
2022-01-12Migrate abi-sysv64 abi-sysv64-register-usage test to asm!Tomasz Miąsko-32/+30
2021-11-22add rustc option for using LLVM stack smash protectionBenjamin A. Bjørnseth-0/+99
LLVM has built-in heuristics for adding stack canaries to functions. These heuristics can be selected with LLVM function attributes. This patch adds a rustc option `-Z stack-protector={none,basic,strong,all}` which controls the use of these attributes. This gives rustc the same stack smash protection support as clang offers through options `-fno-stack-protector`, `-fstack-protector`, `-fstack-protector-strong`, and `-fstack-protector-all`. The protection this can offer is demonstrated in test/ui/abi/stack-protector.rs. This fills a gap in the current list of rustc exploit mitigations (https://doc.rust-lang.org/rustc/exploit-mitigations.html), originally discussed in #15179. Stack smash protection adds runtime overhead and is therefore still off by default, but now users have the option to trade performance for security as they see fit. An example use case is adding Rust code in an existing C/C++ code base compiled with stack smash protection. Without the ability to add stack smash protection to the Rust code, the code base artifacts could be exploitable in ways not possible if the code base remained pure C/C++. Stack smash protection support is present in LLVM for almost all the current tier 1/tier 2 targets: see test/assembly/stack-protector/stack-protector-target-support.rs. The one exception is nvptx64-nvidia-cuda. This patch follows clang's example, and adds a warning message printed if stack smash protection is used with this target (see test/ui/stack-protector/warn-stack-protector-unsupported.rs). Support for tier 3 targets has not been checked. Since the heuristics are applied at the LLVM level, the heuristics are expected to add stack smash protection to a fraction of functions comparable to C/C++. Some experiments demonstrating how Rust code is affected by the different heuristics can be found in test/assembly/stack-protector/stack-protector-heuristics-effect.rs. There is potential for better heuristics using Rust-specific safety information. For example it might be reasonable to skip stack smash protection in functions which transitively only use safe Rust code, or which uses only a subset of functions the user declares safe (such as anything under `std.*`). Such alternative heuristics could be added at a later point. LLVM also offers a "safestack" sanitizer as an alternative way to guard against stack smashing (see #26612). This could possibly also be included as a stack-protection heuristic. An alternative is to add it as a sanitizer (#39699). This is what clang does: safestack is exposed with option `-fsanitize=safe-stack`. The options are only supported by the LLVM backend, but as with other codegen options it is visible in the main codegen option help menu. The heuristic names "basic", "strong", and "all" are hopefully sufficiently generic to be usable in other backends as well. Reviewed-by: Nikita Popov <nikic@php.net> Extra commits during review: - [address-review] make the stack-protector option unstable - [address-review] reduce detail level of stack-protector option help text - [address-review] correct grammar in comment - [address-review] use compiler flag to avoid merging functions in test - [address-review] specify min LLVM version in fortanix stack-protector test Only for Fortanix test, since this target specifically requests the `--x86-experimental-lvi-inline-asm-hardening` flag. - [address-review] specify required LLVM components in stack-protector tests - move stack protector option enum closer to other similar option enums - rustc_interface/tests: sort debug option list in tracking hash test - add an explicit `none` stack-protector option Revert "set LLVM requirements for all stack protector support test revisions" This reverts commit a49b74f92a4e7d701d6f6cf63d207a8aff2e0f68.
2021-11-14Move some tests to more reasonable directoriesCaio-0/+107
2021-10-25make thiscall on unsupported platforms an errorDrMeepster-40/+28
2021-08-30Disallow the aapcs CC on Aarch64Simonas Kazlauskas-27/+99
This never really worked and makes LLVM assert.
2021-08-27Tracking issue for UNSUPPORTED_CALLING_CONVENTIONSSimonas Kazlauskas-4/+4
2021-08-15Fix ui tests for llvm_asm! deprecationAmanieu d'Antras-0/+1
2021-07-06Replace per-target ABI denylist with an allowlistSimonas Kazlauskas-0/+203
It makes very little sense to maintain denylists of ABIs when, as far as non-generic ABIs are concerned, targets usually only support a small subset of the available ABIs. This has historically been a cause of bugs such as us allowing use of the platform-specific ABIs on x86 targets – these in turn would cause LLVM errors or assertions to fire. Fixes #57182 Sponsored by: standard.ai
2021-03-06Move some tests to more suitable subdirsYuki Okushi-0/+28
2021-01-16Move some tests to more reasonable directories - 2Caio-0/+40
Address comments Update limits
2021-01-13Update code to account for extern ABI requirementMark Rousskov-1/+1
2021-01-13Update tests for extern block lintingMark Rousskov-182/+176
2021-01-10Use standard formatting for "rust-call" ABI messageCamelid-8/+8
Nearly all error messages start with a lowercase letter and don't use articles - instead they refer to the plural case.
2020-12-03Update stderrRune Tynan-1/+19
2020-12-03Fix ui testRune Tynan-2/+1
2020-12-03Add more complete tests of possible rust-call casesRune Tynan-0/+25
2020-11-22Drop support for cloudabi targetsLzu Tao-3/+0
2020-11-11Add a sane error for rust-call functions not taking tuples during type ↵Rune Tynan-0/+25
checking, and associated UI tests
2020-08-19Enable stack-overflow detection on musl for non-main threadsTomasz Miąsko-1/+0
2020-06-24lints: add `improper_ctypes_definitions`David Wood-0/+1
This commit adds a new lint - `improper_ctypes_definitions` - which functions identically to `improper_ctypes`, but on `extern "C" fn` definitions (as opposed to `improper_ctypes`'s `extern "C" {}` declarations). Signed-off-by: David Wood <david@davidtw.co>
2020-03-26Update tests to use llvm_asm!Amanieu d'Antras-29/+29
2020-02-08Auto merge of #68452 - msizanoen1:riscv-abi, r=nagisa,eddybbors-1/+51
Implement proper C ABI lowering for RISC-V This is necessary for full RISC-V psABI compliance when passing argument across C FFI boundary. cc @lenary
2020-02-08test: address comments and pacify the merciless tidy.Eduard-Mihai Burtescu-3/+11
2020-02-08Add non-C-like enumeration tests on Rust->C calls to the ↵John VanEnk-0/+73
abi-sysv64-arg-passing test.
2020-02-04Add tests for RISC-V C ABImsizanoen1-1/+51
2019-12-22Remove mem::uninitalized from testsMark Rousskov-7/+8
This purges uses of uninitialized where possible from test cases. Some are merely moved over to the equally bad pattern of MaybeUninit::uninit().assume_init() but with an annotation that this is "the best we can do".
2019-11-13Revert "Auto merge of #65134 - ↵Robin Kruppe-1/+0
davidtwco:issue-19834-improper-ctypes-in-extern-C-fn, r=rkruppe" This reverts commit 3f0e16473de5ec010f44290a8c3ea1d90e0ad7a2, reversing changes made to 61a551b4939ec1d5596e585351038b8fbd0124ba.
2019-11-05improper_ctypes: `extern "C"` fnsDavid Wood-0/+1
2019-10-25Re-enable Emscripten's exception handling supportThomas Lively-4/+0
Passes LLVM codegen and Emscripten link-time flags for exception handling if and only if the panic strategy is `unwind`. Sets the default panic strategy for Emscripten targets to `unwind`. Re-enables tests that depend on unwinding support for Emscripten, including `should_panic` tests.
2019-10-16Upgrade Emscripten targets to use upstream LLVM backendThomas Lively-0/+4
- Compatible with Emscripten 1.38.46-upstream or later upstream. - Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the old incorrect wasm32 C call ABI with the correct one, preserving the old one as wasm32_bindgen_compat for wasm-bindgen compatibility. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649.
2019-10-12test unwind(abort) with Rust ABIRalf Jung-40/+0
2019-10-05Revert "Auto merge of #63649 - tlively:emscripten-upstream-upgrade, ↵Tyler Mandry-4/+0
r=alexcrichton" This reverts commit 7870050796e5904a0fc85ecbe6fa6dde1cfe0c91, reversing changes made to 2e7244807a7878f6eca3eb7d97ae9b413aa49014.
2019-10-04Upgrade Emscripten targets to use upstream LLVM backendThomas Lively-0/+4
- Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the incorrect wasm32 C call ABI with the old asmjs version, which is correct for both wasm32 and JS. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Temporarily makes Emscripten targets use panic=abort by default because supporting unwinding will require an LLVM patch.