Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 2 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4304b7b
add rdg push git config entry for git protocol pushers (again)
tshepang Jul 21, 2025
c8ef211
already documented elsewhere
tshepang Jul 21, 2025
ff2bfe0
Merge pull request #2514 from rust-lang/tshepang/for-ssh-protocol
Kobzol Jul 21, 2025
9ae298c
typo
tshepang Jul 21, 2025
44bec00
Merge pull request #2515 from rust-lang/tshepang-patch-1
tshepang Jul 21, 2025
a9fd8d0
bootstrap: Move musl-root fallback out of sanity check
Gelbpunkt Jul 22, 2025
6c96e7a
Update josh sync documentation
Kobzol Jul 23, 2025
de93fb1
Add `ignore-backends` annotations in failing GCC backend ui tests
GuillaumeGomez Jul 23, 2025
910ee2d
Fix `compiletest` bad handling of `ignore-backends`
GuillaumeGomez Jul 23, 2025
f75595d
add codegen test for variadics (also replacing some existing does-thi…
RalfJung Jul 23, 2025
23fda60
RustWrapper: Suppress getNextNonDebugInfoInstruction
heiher Jul 23, 2025
e7441fb
Clippy fixup
Gelbpunkt Jul 23, 2025
78fc7c3
Suggest unwrapping when private method name is available in inner type
estebank Jul 23, 2025
732097e
disable cfg.has_reliable_f128 on amdgcn
ZuseZ4 Jul 23, 2025
1115345
Prepare for merging from rust-lang/rust
invalid-email-address Jul 24, 2025
e5b1e7d
Merge ref 'efd420c770bb' from rust-lang/rust
invalid-email-address Jul 24, 2025
963cd8a
test using multiple c-variadic ABIs in the same program
folkertdev Jul 23, 2025
1ecb68d
Merge pull request #2517 from Kobzol/josh-sync
Kobzol Jul 24, 2025
b8d628c
Use LocalKey<Cell> methods more
camsteffen Jul 22, 2025
a2b3d81
Call `is_parsed_attribute` rather than keeping track of a list of par…
JonathanBrouwer Jul 24, 2025
1de927c
library/windows_targets: Fix macro expansion error in 'link' macro
itf Jul 24, 2025
97676e6
Allow setting `release-blog-post` label with rustbot
BoxyUwU Jul 24, 2025
546885c
tests: aarch64-outline-atomics: Remove hardcoded target
Gelbpunkt Jul 25, 2025
e69303f
Merge pull request #2518 from rust-lang/rustc-pull
tshepang Jul 25, 2025
73e534b
Revert "Move `shared_helpers` test to a dedicated module"
jieyouxu Jul 25, 2025
430f4f5
Check `./x check bootstrap` in `pr-check-1`
jieyouxu Jul 25, 2025
2a45d94
Rollup merge of #144316 - Gelbpunkt:musl-libdir-bootstrap, r=Kobzol
GuillaumeGomez Jul 25, 2025
82867b1
Rollup merge of #144352 - heiher:llvm-22, r=dianqk
GuillaumeGomez Jul 25, 2025
9c233e6
Rollup merge of #144356 - GuillaumeGomez:gcc-ignore-tests, r=jieyouxu
GuillaumeGomez Jul 25, 2025
c5d38e8
Rollup merge of #144359 - RalfJung:vararg-codegen, r=compiler-errors
GuillaumeGomez Jul 25, 2025
27ac39c
Rollup merge of #144376 - estebank:issue-143795, r=lcnr
GuillaumeGomez Jul 25, 2025
fb793ab
Rollup merge of #144379 - folkertdev:c-variadic-same-program-multiple…
GuillaumeGomez Jul 25, 2025
a492a65
Rollup merge of #144383 - ZuseZ4:disable-f128-on-amdgcn, r=oli-obk
GuillaumeGomez Jul 25, 2025
476e080
Rollup merge of #144412 - camsteffen:localkey-cell-refactors, r=petro…
GuillaumeGomez Jul 25, 2025
e7857ff
Rollup merge of #144421 - JonathanBrouwer:cleanup-malformed-list, r=o…
GuillaumeGomez Jul 25, 2025
a887f3d
Rollup merge of #144422 - itf:itf-patch-2-1, r=ChrisDenton
GuillaumeGomez Jul 25, 2025
d008693
Rollup merge of #144424 - BoxyUwU:release_blog_post_unauthorized_user…
GuillaumeGomez Jul 25, 2025
3eed34e
Rollup merge of #144430 - Gelbpunkt:aarch64-outline-atomics-target, r…
GuillaumeGomez Jul 25, 2025
09a39e4
Rollup merge of #144435 - tshepang:rdg-sync, r=jieyouxu
GuillaumeGomez Jul 25, 2025
16d5f24
Rollup merge of #144445 - jieyouxu:revert-shared_helpers_tests, r=Kobzol
GuillaumeGomez Jul 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions tests/ui/c-variadic/same-program-multiple-abis.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#![feature(extended_varargs_abi_support)]
//@ run-pass
//@ only-x86_64

// Check that multiple c-variadic calling conventions can be used in the same program.
//
// Clang and gcc reject defining functions with a non-default calling convention and a variable
// argument list, so C programs that use multiple c-variadic calling conventions are unlikely
// to come up. Here we validate that our codegen backends do in fact generate correct code.

extern "sysv64" {
fn variadic_sysv64(_: u32, _: ...) -> u32;
}

extern "win64" {
fn variadic_win64(_: u32, _: ...) -> u32;
}

fn main() {
unsafe {
assert_eq!(variadic_win64(1, 2, 3), 1 + 2 + 3);
assert_eq!(variadic_sysv64(1, 2, 3), 1 + 2 + 3);
}
}

// This assembly was generated using https://godbolt.org/z/dbTGanoh6, and corresponds to the
// following code compiled for the `x86_64-unknown-linux-gnu` and `x86_64-pc-windows-gnu`
// targets, respectively:
//
// ```rust
// #![feature(c_variadic)]
//
// #[unsafe(no_mangle)]
// unsafe extern "C" fn variadic(a: u32, mut args: ...) -> u32 {
// let b = args.arg::<u32>();
// let c = args.arg::<u32>();
//
// a + b + c
// }
// ```
core::arch::global_asm!(
r#"
variadic_sysv64:
sub rsp, 88
test al, al
je .LBB0_7
movaps xmmword ptr [rsp - 48], xmm0
movaps xmmword ptr [rsp - 32], xmm1
movaps xmmword ptr [rsp - 16], xmm2
movaps xmmword ptr [rsp], xmm3
movaps xmmword ptr [rsp + 16], xmm4
movaps xmmword ptr [rsp + 32], xmm5
movaps xmmword ptr [rsp + 48], xmm6
movaps xmmword ptr [rsp + 64], xmm7
.LBB0_7:
mov qword ptr [rsp - 88], rsi
mov qword ptr [rsp - 80], rdx
mov qword ptr [rsp - 72], rcx
mov qword ptr [rsp - 64], r8
mov qword ptr [rsp - 56], r9
movabs rax, 206158430216
mov qword ptr [rsp - 120], rax
lea rax, [rsp + 96]
mov qword ptr [rsp - 112], rax
lea rax, [rsp - 96]
mov qword ptr [rsp - 104], rax
mov edx, 8
cmp rdx, 41
jae .LBB0_1
mov rax, qword ptr [rsp - 104]
mov ecx, 8
add rcx, 8
mov dword ptr [rsp - 120], ecx
mov eax, dword ptr [rax + rdx]
cmp edx, 32
ja .LBB0_2
add rcx, qword ptr [rsp - 104]
add edx, 16
mov dword ptr [rsp - 120], edx
add eax, edi
add eax, dword ptr [rcx]
add rsp, 88
ret
.LBB0_1:
mov rax, qword ptr [rsp - 112]
lea rcx, [rax + 8]
mov qword ptr [rsp - 112], rcx
mov eax, dword ptr [rax]
.LBB0_2:
mov rcx, qword ptr [rsp - 112]
lea rdx, [rcx + 8]
mov qword ptr [rsp - 112], rdx
add eax, edi
add eax, dword ptr [rcx]
add rsp, 88
ret

variadic_win64:
push rax
mov qword ptr [rsp + 40], r9
mov qword ptr [rsp + 24], rdx
mov qword ptr [rsp + 32], r8
lea rax, [rsp + 40]
mov qword ptr [rsp], rax
lea eax, [rdx + rcx]
add eax, r8d
pop rcx
ret
"#
);