about summary refs log tree commit diff
path: root/tests/codegen/issues
AgeCommit message (Collapse)AuthorLines
2025-03-09Rollup merge of #122790 - Zoxc:dllimp-rev, r=ChrisDentonMatthias Krüger-28/+0
Apply dllimport in ThinLTO This partially reverts https://github.com/rust-lang/rust/pull/103353 by properly applying `dllimport` if `-Z dylib-lto` is passed. That PR should probably fully be reverted as it looks quite sketchy. We don't know locally if the entire crate graph would be statically linked. This should hopefully be sufficient to make ThinLTO work for rustc on Windows. r? ``@wesleywiser`` --- Edit: This PR is changed to just generally revert https://github.com/rust-lang/rust/pull/103353.
2025-03-06Use `trunc nuw`+`br` for 0/1 branches even in optimized buildsScott McMurray-3/+27
Rather than needing to use `switch` for them to include the `unreachable` arm
2025-03-03Apply dllimport in ThinLTOJohn Kåre Alsaker-28/+0
2025-03-03Rollup merge of #137826 - karolzwolak:looping_over_ne_bytes_133528, r=DianQKMatthias Krüger-0/+17
test(codegen): add looping_over_ne_bytes test for #133528 Adds test for #133528. I renamed the function to `looping_over_ne_bytes` to better reflect that it is doing. I also set the min llvm version to 20 as this was presumably a llvm bug that was fixed in version 20. I didn't tie the test to any specific architecture, as we are testing llvm output.
2025-03-01Rollup merge of #137818 - durin42:llvm-21-remove-readonly, r=jieyouxuMatthias Krüger-1/+0
tests: adapt for LLVM 21 changes Per discussion in #137799 we don't really need this readonly attribute, so let's just drop it so the test passes on LLVM 21. Fixes #137799.
2025-02-28test(codegen): add looping_over_ne_bytes test for #133528Karol Zwolak-0/+17
2025-02-28tests: adapt for LLVM 21 changesAugie Fackler-1/+0
Per discussion in #137799 we don't really need this readonly attribute, so let's just drop it so the test passes on LLVM 21. Fixes #137799.
2025-02-27use the right feature in codegen testsFolkert de Vries-1/+1
2025-02-27remove most `simd_` intrinsic declaration in testsFolkert de Vries-4/+1
instead, we can just import the intrinsics from core
2025-02-24tests: tighten `CHECK-NOT`s to make `str-to-string-128690.rs` less likely to ↵许杰友 Jieyou Xu (Joe)-4/+6
collide with symbol name mangling
2025-02-18x86-sse2 ABI: use SSE registers for floats and SIMDRalf Jung-3/+3
2025-02-13Set both `nuw` and `nsw` in slice size calculationScott McMurray-1/+11
There's an old note in the code to do this, and now that LLVM-C has an API for it, we might as well.
2025-02-11tests/codegen: use -Copt-level=3 instead of -OJubilee Young-55/+55
2025-02-09tests: issue-122805 -> dont-shuffle-bswapsJubilee Young-58/+0
2025-01-31`#[optimize(none)]` implies `#[inline(never)]`clubby789-0/+21
2024-12-19Explicitly register `MSVC`/`NONMSVC` revisions for some codegen tests许杰友 Jieyou Xu (Joe)-19/+28
2024-12-17Use field init shorthand where possibleJosh Triplett-1/+1
Field init shorthand allows writing initializers like `tcx: tcx` as `tcx`. The compiler already uses it extensively. Fix the last few places where it isn't yet used.
2024-12-05Adapt codegen tests for NUW inferenceTim Neumann-8/+8
2024-12-03Auto merge of #104342 - mweber15:add_file_location_to_more_types, r=wesleywiserbors-0/+112
Require `type_map::stub` callers to supply file information This change attaches file information (`DIFile` reference and line number) to struct debug info nodes. Before: ``` ; foo.ll ... !5 = !DIFile(filename: "<unknown>", directory: "") ... !16 = !DICompositeType(tag: DW_TAG_structure_type, name: "MyType", scope: !2, file: !5, size: 32, align: 32, elements: !17, templateParams: !19, identifier: "4cb373851db92e732c4cb5651b886dd0") ... ``` After: ``` ; foo.ll ... !3 = !DIFile(filename: "foo.rs", directory: "/home/matt/src/rust98678", checksumkind: CSK_SHA1, checksum: "bcb9f08512c8f3b8181ef4726012bc6807bc9be4") ... !16 = !DICompositeType(tag: DW_TAG_structure_type, name: "MyType", scope: !2, file: !3, line: 3, size: 32, align: 32, elements: !17, templateParams: !19, identifier: "9e5968c7af39c148acb253912b7f409f") ... ``` Fixes #98678 r? `@wesleywiser`
2024-12-02Fix tests when using MinGWMatt Weber-4/+4
2024-11-28Share inline(never) generics across cratesMark Rousskov-1/+4
This reduces code sizes and better respects programmer intent when marking inline(never). Previously such a marking was essentially ignored for generic functions, as we'd still inline them in remote crates.
2024-11-06Fix relative lines in coroutine testMatt Weber-2/+2
2024-11-06Use -DAG to handle use of file before definitionWesley Wiser-4/+4
Also fixup the test assertion for msvc and unix
2024-11-06Restructure `compile-flags` for testsMatt Weber-12/+8
Optimization needs to be explicitly disabled now.
2024-11-06Update compile flags formattingMatt Weber-5/+5
2024-11-06Rename generator test fileMatt Weber-7/+7
2024-11-06Rename option and add docMatt Weber-4/+4
2024-11-06Move additional source location info behind -Z optionMatt Weber-14/+15
2024-11-06Move tests into issues directoryMatt Weber-0/+115
2024-11-02Add a Few Codegen TestsVeera-0/+45
2024-10-21move strict provenance lints to new feature gate, remove old feature gatesRalf Jung-1/+0
2024-10-19Add codegen test for branchy bool matchclubby789-0/+27
2024-10-11Avoid superfluous UB checks in `IndexRange`Josh Stone-0/+5
`IndexRange::len` is justified as an overall invariant, and `take_prefix` and `take_suffix` are justified by local branch conditions. A few more UB-checked calls remain in cases that are only supported locally by `debug_assert!`, which won't do anything in distributed builds, so those UB checks may still be useful. We generally expect core's `#![rustc_preserve_ub_checks]` to optimize away in user's release builds, but the mere presence of that extra code can sometimes inhibit optimization, as seen in #131563.
2024-09-23Improve autovectorization of to_lowercase / to_uppercase functionsJörn Horstmann-0/+23
Refactor the code in the `convert_while_ascii` helper function to make it more suitable for auto-vectorization and also process the full ascii prefix of the string. The generic case conversion logic will only be invoked starting from the first non-ascii character. The runtime on microbenchmarks with ascii-only inputs improves between 1.5x for short and 4x for long inputs on x86_64 and aarch64. The new implementation also encapsulates all unsafe inside the `convert_while_ascii` function. Fixes #123712
2024-09-22tests: Remove spuriously failing vec-tryinto-array codegen testJubilee Young-22/+0
2024-09-20Rollup merge of #128209 - beetrees:no-macos-10.10, r=jieyouxuGuillaume Gomez-27/+0
Remove macOS 10.10 dynamic linker bug workaround Rust's current minimum macOS version is 10.12, so the hack can be removed. This PR also updates the `remove_dir_all` docs to reflect that all supported macOS versions are protected against TOCTOU race conditions (the fallback implementation was already removed in #127683). try-job: dist-x86_64-apple try-job: dist-aarch64-apple try-job: dist-apple-various try-job: aarch64-apple try-job: x86_64-apple-1
2024-09-18Update the minimum external LLVM to 18Josh Stone-2/+0
2024-09-04Remove macOS 10.10 dynamic linker bug workaroundbeetrees-27/+0
2024-08-31ignore/fix layout-sensitive testsThe 8472-0/+1
2024-08-14Rollup merge of #128759 - notriddle:notriddle/spec-to-string, ↵Matthias Krüger-0/+36
r=workingjubilee,compiler-errors alloc: add ToString specialization for `&&str` Fixes #128690
2024-08-12Auto merge of #128371 - andjo403:rangeAttribute, r=nikicbors-1/+1
Add range attribute to scalar function results and arguments as LLVM 19 adds the range attribute this starts to use it for better optimization. hade been interesting to see a perf run with the https://github.com/rust-lang/rust/pull/127513 closes https://github.com/rust-lang/rust/issues/50156 cc https://github.com/rust-lang/rust/issues/49572 shall be fixed but not possible to see as there is asserts that already trigger the optimization.
2024-08-11Add range attribute to scalar function results and argumentsAndreas Jonson-1/+1
2024-08-10Auto merge of #128584 - DianQK:tests-for-llvm-19, r=nikicbors-0/+67
Add a set of tests for LLVM 19 Close #107681. Close #118306. Close #126585. r? compiler
2024-08-08Add a set of tests for LLVM 19DianQK-0/+67
2024-08-06alloc: add ToString specialization for `&&str`Michael Howell-0/+36
Fixes #128690
2024-08-03Add test for updating enum discriminant through pointerclubby789-0/+19
2024-07-14reenable some windows testsklensy-1/+0
2024-07-12Auto merge of #123351 - beetrees:x86-ret-snan-rust, r=nikic,workingjubileebors-2/+8
Ensure floats are returned losslessly by the Rust ABI on 32-bit x86 Solves #115567 for the (default) `"Rust"` ABI. When compiling for 32-bit x86, this PR changes the `"Rust"` ABI to return floats indirectly instead of in x87 registers (with the exception of single `f32`s, which this PR returns in general purpose registers as they are small enough to fit in one). No change is made to the `"C"` ABI as that ABI requires x87 register usage and therefore will need a different solution.
2024-07-12Adjust tests for x86 "Rust" ABI changesbeetrees-2/+8
2024-06-19Give inlining bonuses to things that optimize outScott McMurray-1/+5