Commit graph

22 commits

Author SHA1 Message Date
Ryan Ward
a2fcb0de18 fix: add CHECK directives to ret comments and be more pervasive with directive contents 2026-01-03 12:50:38 +10:30
Ryan
3df06f5083
fix: use std::num::NonZero instead of extern crate and extend information in CHECK- directives
Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
2026-01-03 10:53:54 +10:30
Ryan Ward
66c4ead02d fix: added further CHECK-SAME labels and replaced all struct input tests with NonZero<u8> input 2026-01-02 12:54:17 +10:30
Ryan
bf2078bfca
fix: add CHECK-SAME labels to verify generated function type for u8 and [u8; 1] cases
Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
2026-01-02 12:01:55 +10:30
Ryan Ward
80acf74fb6 test: added codegen tests for permutations of Option::or 2026-01-01 22:28:32 +10:30
Zachary S
9a8dc7e17c Replace uses of 'CHECK: br' and 'CHECK-NOT: br' with 'br {{.*}}'.
v0 mangling can produce symbols with 'br' as a substring, leading to false positives for CHECK-NOT
2025-11-21 13:04:48 -06:00
David Wood
ff00110543
sess: default to v0 symbol mangling
Rust's current mangling scheme depends on compiler internals; loses
information about generic parameters (and other things) which makes for
a worse experience when using external tools that need to interact with
Rust symbol names; is inconsistent; and can contain `.` characters
which aren't universally supported. Therefore, Rust has defined its own
symbol mangling scheme which is defined in terms of the Rust language,
not the compiler implementation; encodes information about generic
parameters in a reversible way; has a consistent definition; and
generates symbols that only use the characters `A-Z`, `a-z`, `0-9`, and
`_`.

Support for the new Rust symbol mangling scheme has been added to
upstream tools that will need to interact with Rust symbols (e.g.
debuggers).

This commit changes the default symbol mangling scheme from the legacy
scheme to the new Rust mangling scheme.

Signed-off-by: David Wood <david.wood@huawei.com>
2025-11-19 11:55:09 +00:00
Matthias Krüger
c772af78e9
Rollup merge of #146732 - durin42:llvm-22-less-assumes, r=nikic
tests: relax expectations after llvm change 902ddda120a5

LLVM 22 is able to drop assumes that seem to not help further optimizations, which actually seems to dramatically _help_ further optimizations in some of our small test cases.

I'm a little unclear how to fix the last failure, in `tests/codegen-llvm/issues/issue-122600-ptr-discriminant-update.rs`:

```
-; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: write) uwtable
+; Function Attrs: mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: readwrite, inaccessiblemem: write) uwtable
 define void ``@update(ptr`` noundef captures(none) %s) unnamed_addr #0 {
 start:
-  %_3.sroa.0.0.copyload = load i8, ptr %s, align 1
-  %0 = trunc nuw i8 %_3.sroa.0.0.copyload to i1
-  %1 = xor i1 %0, true
-  tail call void ``@llvm.assume(i1`` %1)
   store i8 1, ptr %s, align 1
   ret void
 }
```

I'm just not conversant enough in LLVM IR to follow the changes here.

``@rustbot`` label llvm-main
r? nikic
2025-09-27 21:25:57 +02:00
Augie Fackler
99456cc015 tests: use max-llvm-major-version instead of ignore-llvm-version 2025-09-26 13:32:03 -04:00
The 8472
5f0a68eb22 regression test for https://github.com/rust-lang/rust/issues/117763 2025-09-21 19:54:43 +02:00
Augie Fackler
e32b975e84 tests: relax expectations after llvm change 902ddda120a5
LLVM 22 is able to drop assumes that seem to not help further
optimizations, which actually seems to dramatically _help_ further
optimizations in some of our small test cases.
2025-09-19 13:56:19 -04:00
Josh Stone
580b4891aa Update the minimum external LLVM to 20 2025-09-16 11:49:20 -07:00
Hans Wennborg
4ecca581fa Adjust issue-118306.rs test after LLVM change
This updates tests/codegen-llvm/issues/issue-118306.rs to pass also
after https://github.com/llvm/llvm-project/pull/155415
2025-09-02 12:04:04 +02:00
Jacob Pratt
f0a414870a
Rollup merge of #145380 - okaneco:add-codegen-tests, r=Mark-Simulacrum
Add codegen-llvm regression tests

Most of these regressions deal with elimination of panics and bounds checks that were fixed upstream by LLVM.

closes https://github.com/rust-lang/rust/issues/141497
closes https://github.com/rust-lang/rust/issues/131162
closes https://github.com/rust-lang/rust/issues/129583
closes https://github.com/rust-lang/rust/issues/110971
closes https://github.com/rust-lang/rust/issues/91109
closes https://github.com/rust-lang/rust/issues/80075
closes https://github.com/rust-lang/rust/issues/74917
closes https://github.com/rust-lang/rust/issues/71997
closes https://github.com/rust-lang/rust/issues/71257
closes https://github.com/rust-lang/rust/issues/59352
2025-08-22 22:00:50 -04:00
Karl Meakin
377a0c88a9 Consolidate panicking functions in slice/index.rs
Consolidate all the panicking functions in `slice/index.rs` to use a single
`slice_index_fail` function, similar to how it is done in `str/traits.rs`.
2025-08-21 11:07:25 +01:00
okaneco
9e28de2720 Add codegen regression tests
Most of these regressions concern elimination of panics and bounds
checks that were fixed upstream by LLVM.
2025-08-20 22:29:45 -04:00
Stuart Cook
3a694c7595
Rollup merge of #145355 - clubby789:option-match-eq, r=nikic
Add codegen test for issue 122734

Closes rust-lang/rust#122734
2025-08-18 15:31:12 +10:00
Stuart Cook
0166de2f87
Rollup merge of #145120 - maurer:llvm-time, r=nikic
llvm: Accept new LLVM lifetime format

In llvm/llvm-project#150248 LLVM removed the size parameter from the lifetime format. Tolerate not having that size parameter.
2025-08-15 16:16:37 +10:00
Jamie Hill-Daniel
9b9206980e Add test for issue 122734 2025-08-13 14:24:28 +00:00
Matthew Maurer
258915a555 llvm: Accept new LLVM lifetime format
LLVM removed the size parameter from the lifetime format.
Tolerate not having that size parameter.
2025-08-11 22:00:41 +00:00
okaneco
163594c8f8 Add regression test for saturating_sub bounds check issue
Add codegen test for issue where `valid_index.saturating_sub(X)` produced an
extra bounds check.
This was fixed by the LLVM upgrade.
2025-08-07 15:11:52 -04:00
Guillaume Gomez
a27f3e3fd1 Rename tests/codegen into tests/codegen-llvm 2025-07-22 14:28:48 +02:00