Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 3 additions & 5 deletions src/tools/compiletest/src/directives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,11 +644,9 @@ impl TestProps {

self.update_add_core_stubs(ln, config);

if let Some(flags) = config.parse_name_value_directive(
ln,
directives::CORE_STUBS_COMPILE_FLAGS,
testfile,
) {
if let Some(flags) =
config.parse_name_value_directive(ln, CORE_STUBS_COMPILE_FLAGS, testfile)
{
let flags = split_flags(&flags);
for flag in &flags {
if flag == "--edition" || flag.starts_with("--edition=") {
Expand Down
2 changes: 2 additions & 0 deletions src/tools/compiletest/src/directives/directive_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ pub(crate) const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
"only-aarch64-unknown-linux-gnu",
"only-apple",
"only-arm",
"only-arm64ec",
"only-avr",
"only-beta",
"only-bpf",
Expand All @@ -217,6 +218,7 @@ pub(crate) const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
"only-nightly",
"only-nvptx64",
"only-powerpc",
"only-riscv32",
"only-riscv64",
"only-rustc_abi-x86-sse2",
"only-s390x",
Expand Down
53 changes: 53 additions & 0 deletions tests/ui/asm/label-operand.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
//@ run-pass
//@ reference: asm.operand-type.supported-operands.label
//@ revisions: aarch64 arm arm64ec riscv32 riscv64 x86 x86_64
//@ needs-asm-support
//@[aarch64] only-aarch64
//@[arm64ec] only-arm64ec
//@[arm] only-arm
//@[riscv32] only-riscv32
//@[riscv64] only-riscv64
//@[x86] only-x86
//@[x86_64] only-x86_64

#[cfg(any(aarch64, arm, arm64ec))]
fn make_true(value: &mut bool) {
unsafe {
core::arch::asm!(
"b {}",
label {
*value = true;
}
);
}
}

#[cfg(any(riscv32, riscv64))]
fn make_true(value: &mut bool) {
unsafe {
core::arch::asm!(
"j {}",
label {
*value = true;
}
);
}
}

#[cfg(any(x86, x86_64))]
fn make_true(value: &mut bool) {
unsafe {
core::arch::asm!(
"jmp {}",
label {
*value = true;
}
);
}
}

fn main() {
let mut value = false;
make_true(&mut value);
assert!(value);
}
Loading