about summary refs log tree commit diff
path: root/tests/codegen/issues
AgeCommit message (Collapse)AuthorLines
2025-07-22Rename `tests/codegen` into `tests/codegen-llvm`Guillaume Gomez-1989/+0
2025-05-17Describe lifetime of call argument temporaries passed indirectlyTomasz Miąsko-27/+0
2025-04-24Rollup merge of #139261 - RalfJung:msvc-align-mitigation, r=oli-obkMatthias Krüger-0/+3
mitigate MSVC alignment issue on x86-32 This implements mitigation for https://github.com/rust-lang/rust/issues/112480 by stopping to emit `align` attributes on loads and function arguments when building for a win32 MSVC target. MSVC is known to not properly align `u64` and similar types, and claiming to LLVM that everything is properly aligned increases the chance that this will cause problems. Of course, the misalignment is still a bug, but we can't fix that bug, only MSVC can. Also add an errata note to the platform support page warning users about this known problem. try-job: `i686-msvc*`
2025-04-17tests: adjust 101082 test for LLVM 21 fixAugie Fackler-10/+2
Fixes #139987.
2025-04-11Auto merge of #139430 - scottmcm:polymorphic-array-into-iter, r=cuviperbors-3/+32
Polymorphize `array::IntoIter`'s iterator impl Today we emit all the iterator methods for every different array width. That's wasteful since the actual array length never even comes into it -- the indices used are from the separate `alive: IndexRange` field, not even the `N` const param. This PR switches things so that an `array::IntoIter<T, N>` stores a `PolymorphicIter<[MaybeUninit<T>; N]>`, which we *unsize* to `PolymorphicIter<[MaybeUninit<T>]>` and call methods on that non-`Sized` type for all the iterator methods. That also necessarily makes the layout consistent between the different lengths of arrays, because of the unsizing. Compare that to today <https://rust.godbolt.org/z/Prb4xMPrb>, where different widths can't even be deduped because the offset to the indices is different for different array widths.
2025-04-10replace `//@ compile-flags: --edition` with `//@ edition`Pietro Albini-1/+2
2025-04-09PR feedbackScott McMurray-6/+12
2025-04-07mitigate MSVC unsoundness by not emitting alignment attributes on win32-msvc ↵Ralf Jung-0/+3
targets also mention the MSVC alignment issue in platform-support.md
2025-04-06Rollup merge of #139438 - Zalathar:fix-test-122600, r=scottmcmStuart Cook-0/+2
Prevent a test from seeing forbidden numbers in the rustc version The final CHECK-NOT directive in this test was able to see past the end of the enclosing function, and find the substring `753` or `754` in the git hash in the rustc version number, causing false failures in CI whenever the git hash happens to contain those digits in sequence. Adding an explicit check for `ret` prevents the CHECK-NOT directive from seeing past the end of the function. --- Manually tested by adding `// CHECK-NOT: rustc` after the existing CHECK-NOT directives, and demonstrating that the new check prevents it from seeing the rustc version string.
2025-04-06Prevent a test from seeing forbidden numbers in the rustc versionZalathar-0/+2
The final CHECK-NOT directive in this test was able to see past the end of the enclosing function, and find the substring 753 or 754 in the git hash in the rustc version number, causing false failures in CI. Adding an explicit check for `ret` prevents the CHECK-NOT directive from seeing past the end of the function.
2025-04-05Polymorphize `array::IntoIter`'s iterator implScott McMurray-1/+24
2025-04-05Update the minimum external LLVM to 19Josh Stone-4/+0
2025-03-14Fix formatting (line too long)KonaeAkira-1/+2
2025-03-14Add codegen test for modulo with power-of-two divisorKonaeAkira-0/+16
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