diff options
| author | bors <bors@rust-lang.org> | 2024-11-25 08:13:44 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-11-25 08:13:44 +0000 |
| commit | 1278dad1e9a46a3a6fb5de80a5620cd2e58196cb (patch) | |
| tree | 4aa87ca24f3ebf4d53208bf8176e3e7d8c0102eb /tests/codegen | |
| parent | 67a8c642592f86eaf3b84030c04e0305d79953d1 (diff) | |
| parent | d2590e0ca3c4cee93b4b9a2c13699213489d4413 (diff) | |
| download | rust-1278dad1e9a46a3a6fb5de80a5620cd2e58196cb.tar.gz rust-1278dad1e9a46a3a6fb5de80a5620cd2e58196cb.zip | |
Auto merge of #133433 - matthiaskrgr:rollup-lfa3wp1, r=matthiaskrgr
Rollup of 8 pull requests
Successful merges:
- #131523 (Fix asm goto with outputs and move it to a separate feature gate)
- #131664 (Support input/output in vector registers of s390x inline assembly (under asm_experimental_reg feature))
- #132432 (Add a test to verify that libstd doesn't use protected symbols)
- #132502 (Document possibility to set core features in example config.toml)
- #132529 (ci(triagebot): add more top-level files to A-meta)
- #132533 (Add BorrowedBuf::into_filled{,_mut} methods to allow returning buffer with original lifetime)
- #132803 (Fix broken url)
- #132982 (alloc: fix `Allocator` method names in `alloc` free function docs)
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests/codegen')
| -rw-r--r-- | tests/codegen/asm/goto.rs | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/tests/codegen/asm/goto.rs b/tests/codegen/asm/goto.rs index e522d0da5b4..c40a43fbe1b 100644 --- a/tests/codegen/asm/goto.rs +++ b/tests/codegen/asm/goto.rs @@ -2,21 +2,10 @@ //@ only-x86_64 #![crate_type = "rlib"] -#![feature(asm_goto)] +#![feature(asm_goto, asm_goto_with_outputs)] use std::arch::asm; -#[no_mangle] -pub extern "C" fn panicky() {} - -struct Foo; - -impl Drop for Foo { - fn drop(&mut self) { - println!(); - } -} - // CHECK-LABEL: @asm_goto #[no_mangle] pub unsafe fn asm_goto() { @@ -38,14 +27,37 @@ pub unsafe fn asm_goto_with_outputs() -> u64 { out } +// CHECK-LABEL: @asm_goto_with_outputs_use_in_label +#[no_mangle] +pub unsafe fn asm_goto_with_outputs_use_in_label() -> u64 { + let out: u64; + // CHECK: [[RES:%[0-9]+]] = callbr i64 asm sideeffect alignstack inteldialect " + // CHECK-NEXT: to label %[[FALLTHROUGHBB:[a-b0-9]+]] [label %[[JUMPBB:[a-b0-9]+]]] + asm!("{} /* {} */", out(reg) out, label { return out; }); + // CHECK: [[JUMPBB]]: + // CHECK-NEXT: [[RET:%.+]] = phi i64 [ 1, %[[FALLTHROUGHBB]] ], [ [[RES]], %start ] + // CHECK-NEXT: ret i64 [[RET]] + 1 +} + // CHECK-LABEL: @asm_goto_noreturn #[no_mangle] pub unsafe fn asm_goto_noreturn() -> u64 { - let out: u64; // CHECK: callbr void asm sideeffect alignstack inteldialect " // CHECK-NEXT: to label %unreachable [label %[[JUMPBB:[a-b0-9]+]]] asm!("jmp {}", label { return 1; }, options(noreturn)); // CHECK: [[JUMPBB]]: // CHECK-NEXT: ret i64 1 +} + +// CHECK-LABEL: @asm_goto_noreturn_with_outputs +#[no_mangle] +pub unsafe fn asm_goto_noreturn_with_outputs() -> u64 { + let out: u64; + // CHECK: [[RES:%[0-9]+]] = callbr i64 asm sideeffect alignstack inteldialect " + // CHECK-NEXT: to label %[[FALLTHROUGHBB:[a-b0-9]+]] [label %[[JUMPBB:[a-b0-9]+]]] + asm!("mov {}, 1", "jmp {}", out(reg) out, label { return out; }); + // CHECK: [[JUMPBB]]: + // CHECK-NEXT: ret i64 [[RES]] out } |
