File tree Expand file tree Collapse file tree 2 files changed +55
-0
lines changed
src/tools/compiletest/src/directives Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Original file line number Diff line number Diff line change @@ -191,6 +191,7 @@ pub(crate) const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
191191 "only-aarch64-unknown-linux-gnu" ,
192192 "only-apple" ,
193193 "only-arm" ,
194+ "only-arm64ec" ,
194195 "only-avr" ,
195196 "only-beta" ,
196197 "only-bpf" ,
@@ -217,6 +218,7 @@ pub(crate) const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
217218 "only-nightly" ,
218219 "only-nvptx64" ,
219220 "only-powerpc" ,
221+ "only-riscv32" ,
220222 "only-riscv64" ,
221223 "only-rustc_abi-x86-sse2" ,
222224 "only-s390x" ,
Original file line number Diff line number Diff line change 1+ //@ run-pass
2+ //@ reference: asm.operand-type.supported-operands.label
3+ //@ revisions: aarch64 arm arm64ec riscv32 riscv64 x86 x86_64
4+ //@ needs-asm-support
5+ //@[aarch64] only-aarch64
6+ //@[arm64ec] only-arm64ec
7+ //@[arm] only-arm
8+ //@[riscv32] only-riscv32
9+ //@[riscv64] only-riscv64
10+ //@[x86] only-x86
11+ //@[x86_64] only-x86_64
12+
13+ #[ cfg( any( aarch64, arm, arm64ec) ) ]
14+ fn make_true ( value : & mut bool ) {
15+ unsafe {
16+ core:: arch:: asm!(
17+ "b {}" ,
18+ label {
19+ * value = true ;
20+ }
21+ ) ;
22+ }
23+ }
24+
25+ #[ cfg( any( riscv32, riscv64) ) ]
26+ fn make_true ( value : & mut bool ) {
27+ unsafe {
28+ core:: arch:: asm!(
29+ "j {}" ,
30+ label {
31+ * value = true ;
32+ }
33+ ) ;
34+ }
35+ }
36+
37+ #[ cfg( any( x86, x86_64) ) ]
38+ fn make_true ( value : & mut bool ) {
39+ unsafe {
40+ core:: arch:: asm!(
41+ "jmp {}" ,
42+ label {
43+ * value = true ;
44+ }
45+ ) ;
46+ }
47+ }
48+
49+ fn main ( ) {
50+ let mut value = false ;
51+ make_true ( & mut value) ;
52+ assert ! ( value) ;
53+ }
You can’t perform that action at this time.
0 commit comments