Add bad-reg inline assembly ui test for RISC-V and s390x
This commit is contained in:
parent
ef972a3466
commit
e97ba53879
212
tests/ui/asm/riscv/bad-reg.riscv32e.stderr
Normal file
212
tests/ui/asm/riscv/bad-reg.riscv32e.stderr
Normal file
@ -0,0 +1,212 @@
|
|||||||
|
error: invalid register `s1`: s1 is used internally by LLVM and cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:40:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("s1") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `fp`: the frame pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:42:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("fp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:44:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("sp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:46:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("gp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:48:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("gp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `tp`: the thread pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:50:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("tp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `zero`: the zero register cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:52:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("zero") _);
|
||||||
|
| ^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:103:18
|
||||||
|
|
|
||||||
|
LL | asm!("", in("v0") x);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:106:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v0") x);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:109:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(vreg) x);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:112:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", out(vreg) _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: cannot use register `x16`: register can't be used with the `e` target feature
|
||||||
|
--> $DIR/bad-reg.rs:55:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("x16") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: cannot use register `x17`: register can't be used with the `e` target feature
|
||||||
|
--> $DIR/bad-reg.rs:57:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("x17") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: cannot use register `x18`: register can't be used with the `e` target feature
|
||||||
|
--> $DIR/bad-reg.rs:59:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("x18") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: cannot use register `x19`: register can't be used with the `e` target feature
|
||||||
|
--> $DIR/bad-reg.rs:61:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("x19") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: cannot use register `x20`: register can't be used with the `e` target feature
|
||||||
|
--> $DIR/bad-reg.rs:63:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("x20") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: cannot use register `x21`: register can't be used with the `e` target feature
|
||||||
|
--> $DIR/bad-reg.rs:65:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("x21") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: cannot use register `x22`: register can't be used with the `e` target feature
|
||||||
|
--> $DIR/bad-reg.rs:67:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("x22") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: cannot use register `x23`: register can't be used with the `e` target feature
|
||||||
|
--> $DIR/bad-reg.rs:69:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("x23") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: cannot use register `x24`: register can't be used with the `e` target feature
|
||||||
|
--> $DIR/bad-reg.rs:71:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("x24") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: cannot use register `x25`: register can't be used with the `e` target feature
|
||||||
|
--> $DIR/bad-reg.rs:73:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("x25") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: cannot use register `x26`: register can't be used with the `e` target feature
|
||||||
|
--> $DIR/bad-reg.rs:75:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("x26") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: cannot use register `x27`: register can't be used with the `e` target feature
|
||||||
|
--> $DIR/bad-reg.rs:77:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("x27") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: cannot use register `x28`: register can't be used with the `e` target feature
|
||||||
|
--> $DIR/bad-reg.rs:79:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("x28") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: cannot use register `x29`: register can't be used with the `e` target feature
|
||||||
|
--> $DIR/bad-reg.rs:81:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("x29") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: cannot use register `x30`: register can't be used with the `e` target feature
|
||||||
|
--> $DIR/bad-reg.rs:83:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("x30") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: cannot use register `x31`: register can't be used with the `e` target feature
|
||||||
|
--> $DIR/bad-reg.rs:85:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("x31") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `freg` requires at least one of the following target features: d, f
|
||||||
|
--> $DIR/bad-reg.rs:89:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(freg) f);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `freg` requires at least one of the following target features: d, f
|
||||||
|
--> $DIR/bad-reg.rs:91:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", out(freg) _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `freg` requires at least one of the following target features: d, f
|
||||||
|
--> $DIR/bad-reg.rs:93:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(freg) d);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `freg` requires at least one of the following target features: d, f
|
||||||
|
--> $DIR/bad-reg.rs:96:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", out(freg) d);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:103:27
|
||||||
|
|
|
||||||
|
LL | asm!("", in("v0") x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:106:28
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v0") x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:109:35
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(vreg) x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: aborting due to 34 previous errors
|
||||||
|
|
92
tests/ui/asm/riscv/bad-reg.riscv32gc.stderr
Normal file
92
tests/ui/asm/riscv/bad-reg.riscv32gc.stderr
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
error: invalid register `s1`: s1 is used internally by LLVM and cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:40:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("s1") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `fp`: the frame pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:42:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("fp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:44:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("sp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:46:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("gp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:48:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("gp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `tp`: the thread pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:50:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("tp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `zero`: the zero register cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:52:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("zero") _);
|
||||||
|
| ^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:103:18
|
||||||
|
|
|
||||||
|
LL | asm!("", in("v0") x);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:106:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v0") x);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:109:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(vreg) x);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:112:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", out(vreg) _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:103:27
|
||||||
|
|
|
||||||
|
LL | asm!("", in("v0") x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:106:28
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v0") x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:109:35
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(vreg) x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: aborting due to 14 previous errors
|
||||||
|
|
116
tests/ui/asm/riscv/bad-reg.riscv32i.stderr
Normal file
116
tests/ui/asm/riscv/bad-reg.riscv32i.stderr
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
error: invalid register `s1`: s1 is used internally by LLVM and cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:40:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("s1") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `fp`: the frame pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:42:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("fp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:44:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("sp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:46:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("gp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:48:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("gp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `tp`: the thread pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:50:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("tp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `zero`: the zero register cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:52:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("zero") _);
|
||||||
|
| ^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:103:18
|
||||||
|
|
|
||||||
|
LL | asm!("", in("v0") x);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:106:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v0") x);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:109:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(vreg) x);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:112:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", out(vreg) _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `freg` requires at least one of the following target features: d, f
|
||||||
|
--> $DIR/bad-reg.rs:89:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(freg) f);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `freg` requires at least one of the following target features: d, f
|
||||||
|
--> $DIR/bad-reg.rs:91:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", out(freg) _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `freg` requires at least one of the following target features: d, f
|
||||||
|
--> $DIR/bad-reg.rs:93:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(freg) d);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `freg` requires at least one of the following target features: d, f
|
||||||
|
--> $DIR/bad-reg.rs:96:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", out(freg) d);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:103:27
|
||||||
|
|
|
||||||
|
LL | asm!("", in("v0") x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:106:28
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v0") x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:109:35
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(vreg) x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: aborting due to 18 previous errors
|
||||||
|
|
108
tests/ui/asm/riscv/bad-reg.riscv32imafc.stderr
Normal file
108
tests/ui/asm/riscv/bad-reg.riscv32imafc.stderr
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
error: invalid register `s1`: s1 is used internally by LLVM and cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:40:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("s1") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `fp`: the frame pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:42:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("fp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:44:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("sp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:46:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("gp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:48:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("gp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `tp`: the thread pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:50:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("tp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `zero`: the zero register cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:52:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("zero") _);
|
||||||
|
| ^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:103:18
|
||||||
|
|
|
||||||
|
LL | asm!("", in("v0") x);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:106:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v0") x);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:109:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(vreg) x);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:112:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", out(vreg) _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: `d` target feature is not enabled
|
||||||
|
--> $DIR/bad-reg.rs:93:35
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(freg) d);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: this is required to use type `f64` with register class `freg`
|
||||||
|
|
||||||
|
error: `d` target feature is not enabled
|
||||||
|
--> $DIR/bad-reg.rs:96:36
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", out(freg) d);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: this is required to use type `f64` with register class `freg`
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:103:27
|
||||||
|
|
|
||||||
|
LL | asm!("", in("v0") x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:106:28
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v0") x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:109:35
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(vreg) x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: aborting due to 16 previous errors
|
||||||
|
|
92
tests/ui/asm/riscv/bad-reg.riscv64gc.stderr
Normal file
92
tests/ui/asm/riscv/bad-reg.riscv64gc.stderr
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
error: invalid register `s1`: s1 is used internally by LLVM and cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:40:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("s1") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `fp`: the frame pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:42:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("fp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:44:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("sp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:46:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("gp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:48:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("gp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `tp`: the thread pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:50:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("tp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `zero`: the zero register cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:52:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("zero") _);
|
||||||
|
| ^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:103:18
|
||||||
|
|
|
||||||
|
LL | asm!("", in("v0") x);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:106:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v0") x);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:109:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(vreg) x);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:112:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", out(vreg) _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:103:27
|
||||||
|
|
|
||||||
|
LL | asm!("", in("v0") x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:106:28
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v0") x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:109:35
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(vreg) x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: aborting due to 14 previous errors
|
||||||
|
|
116
tests/ui/asm/riscv/bad-reg.riscv64imac.stderr
Normal file
116
tests/ui/asm/riscv/bad-reg.riscv64imac.stderr
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
error: invalid register `s1`: s1 is used internally by LLVM and cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:40:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("s1") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `fp`: the frame pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:42:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("fp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `sp`: the stack pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:44:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("sp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:46:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("gp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `gp`: the global pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:48:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("gp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `tp`: the thread pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:50:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("tp") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `zero`: the zero register cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:52:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("zero") _);
|
||||||
|
| ^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:103:18
|
||||||
|
|
|
||||||
|
LL | asm!("", in("v0") x);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:106:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v0") x);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:109:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(vreg) x);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:112:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", out(vreg) _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `freg` requires at least one of the following target features: d, f
|
||||||
|
--> $DIR/bad-reg.rs:89:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(freg) f);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `freg` requires at least one of the following target features: d, f
|
||||||
|
--> $DIR/bad-reg.rs:91:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", out(freg) _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `freg` requires at least one of the following target features: d, f
|
||||||
|
--> $DIR/bad-reg.rs:93:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(freg) d);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `freg` requires at least one of the following target features: d, f
|
||||||
|
--> $DIR/bad-reg.rs:96:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", out(freg) d);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:103:27
|
||||||
|
|
|
||||||
|
LL | asm!("", in("v0") x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:106:28
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v0") x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:109:35
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(vreg) x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: aborting due to 18 previous errors
|
||||||
|
|
115
tests/ui/asm/riscv/bad-reg.rs
Normal file
115
tests/ui/asm/riscv/bad-reg.rs
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
//@ revisions: riscv32i riscv32imafc riscv32gc riscv32e riscv64imac riscv64gc
|
||||||
|
//@[riscv32i] compile-flags: --target riscv32i-unknown-none-elf
|
||||||
|
//@[riscv32i] needs-llvm-components: riscv
|
||||||
|
//@[riscv32imafc] compile-flags: --target riscv32imafc-unknown-none-elf
|
||||||
|
//@[riscv32imafc] needs-llvm-components: riscv
|
||||||
|
//@[riscv32gc] compile-flags: --target riscv32gc-unknown-linux-gnu
|
||||||
|
//@[riscv32gc] needs-llvm-components: riscv
|
||||||
|
//@[riscv32e] compile-flags: --target riscv32e-unknown-none-elf
|
||||||
|
//@[riscv32e] needs-llvm-components: riscv
|
||||||
|
//@[riscv64imac] compile-flags: --target riscv64imac-unknown-none-elf
|
||||||
|
//@[riscv64imac] needs-llvm-components: riscv
|
||||||
|
//@[riscv64gc] compile-flags: --target riscv64gc-unknown-linux-gnu
|
||||||
|
//@[riscv64gc] needs-llvm-components: riscv
|
||||||
|
//@ needs-asm-support
|
||||||
|
|
||||||
|
#![crate_type = "rlib"]
|
||||||
|
#![feature(no_core, rustc_attrs, lang_items, asm_experimental_arch)]
|
||||||
|
#![no_core]
|
||||||
|
|
||||||
|
#[lang = "sized"]
|
||||||
|
trait Sized {}
|
||||||
|
#[lang = "copy"]
|
||||||
|
trait Copy {}
|
||||||
|
|
||||||
|
impl Copy for i32 {}
|
||||||
|
impl Copy for f32 {}
|
||||||
|
impl Copy for f64 {}
|
||||||
|
|
||||||
|
#[rustc_builtin_macro]
|
||||||
|
macro_rules! asm {
|
||||||
|
() => {};
|
||||||
|
}
|
||||||
|
|
||||||
|
fn f() {
|
||||||
|
let mut x = 0;
|
||||||
|
let mut f = 0.0_f32;
|
||||||
|
let mut d = 0.0_f64;
|
||||||
|
unsafe {
|
||||||
|
// Unsupported registers
|
||||||
|
asm!("", out("s1") _);
|
||||||
|
//~^ ERROR invalid register `s1`: s1 is used internally by LLVM and cannot be used as an operand for inline asm
|
||||||
|
asm!("", out("fp") _);
|
||||||
|
//~^ ERROR invalid register `fp`: the frame pointer cannot be used as an operand for inline asm
|
||||||
|
asm!("", out("sp") _);
|
||||||
|
//~^ ERROR invalid register `sp`: the stack pointer cannot be used as an operand for inline asm
|
||||||
|
asm!("", out("gp") _);
|
||||||
|
//~^ ERROR invalid register `gp`: the global pointer cannot be used as an operand for inline asm
|
||||||
|
asm!("", out("gp") _);
|
||||||
|
//~^ ERROR invalid register `gp`: the global pointer cannot be used as an operand for inline asm
|
||||||
|
asm!("", out("tp") _);
|
||||||
|
//~^ ERROR invalid register `tp`: the thread pointer cannot be used as an operand for inline asm
|
||||||
|
asm!("", out("zero") _);
|
||||||
|
//~^ ERROR invalid register `zero`: the zero register cannot be used as an operand for inline asm
|
||||||
|
|
||||||
|
asm!("", out("x16") _);
|
||||||
|
//[riscv32e]~^ ERROR register can't be used with the `e` target feature
|
||||||
|
asm!("", out("x17") _);
|
||||||
|
//[riscv32e]~^ ERROR register can't be used with the `e` target feature
|
||||||
|
asm!("", out("x18") _);
|
||||||
|
//[riscv32e]~^ ERROR register can't be used with the `e` target feature
|
||||||
|
asm!("", out("x19") _);
|
||||||
|
//[riscv32e]~^ ERROR register can't be used with the `e` target feature
|
||||||
|
asm!("", out("x20") _);
|
||||||
|
//[riscv32e]~^ ERROR register can't be used with the `e` target feature
|
||||||
|
asm!("", out("x21") _);
|
||||||
|
//[riscv32e]~^ ERROR register can't be used with the `e` target feature
|
||||||
|
asm!("", out("x22") _);
|
||||||
|
//[riscv32e]~^ ERROR register can't be used with the `e` target feature
|
||||||
|
asm!("", out("x23") _);
|
||||||
|
//[riscv32e]~^ ERROR register can't be used with the `e` target feature
|
||||||
|
asm!("", out("x24") _);
|
||||||
|
//[riscv32e]~^ ERROR register can't be used with the `e` target feature
|
||||||
|
asm!("", out("x25") _);
|
||||||
|
//[riscv32e]~^ ERROR register can't be used with the `e` target feature
|
||||||
|
asm!("", out("x26") _);
|
||||||
|
//[riscv32e]~^ ERROR register can't be used with the `e` target feature
|
||||||
|
asm!("", out("x27") _);
|
||||||
|
//[riscv32e]~^ ERROR register can't be used with the `e` target feature
|
||||||
|
asm!("", out("x28") _);
|
||||||
|
//[riscv32e]~^ ERROR register can't be used with the `e` target feature
|
||||||
|
asm!("", out("x29") _);
|
||||||
|
//[riscv32e]~^ ERROR register can't be used with the `e` target feature
|
||||||
|
asm!("", out("x30") _);
|
||||||
|
//[riscv32e]~^ ERROR register can't be used with the `e` target feature
|
||||||
|
asm!("", out("x31") _);
|
||||||
|
//[riscv32e]~^ ERROR register can't be used with the `e` target feature
|
||||||
|
|
||||||
|
asm!("", out("f0") _); // ok
|
||||||
|
asm!("/* {} */", in(freg) f);
|
||||||
|
//[riscv32i,riscv32e,riscv64imac]~^ ERROR register class `freg` requires at least one of the following target features: d, f
|
||||||
|
asm!("/* {} */", out(freg) _);
|
||||||
|
//[riscv32i,riscv32e,riscv64imac]~^ ERROR register class `freg` requires at least one of the following target features: d, f
|
||||||
|
asm!("/* {} */", in(freg) d);
|
||||||
|
//[riscv32i,riscv32e,riscv64imac]~^ ERROR register class `freg` requires at least one of the following target features: d, f
|
||||||
|
//[riscv32imafc]~^^ ERROR `d` target feature is not enabled
|
||||||
|
asm!("/* {} */", out(freg) d);
|
||||||
|
//[riscv32i,riscv32e,riscv64imac]~^ ERROR register class `freg` requires at least one of the following target features: d, f
|
||||||
|
//[riscv32imafc]~^^ ERROR `d` target feature is not enabled
|
||||||
|
|
||||||
|
// Clobber-only registers
|
||||||
|
// vreg
|
||||||
|
asm!("", out("v0") _); // ok
|
||||||
|
asm!("", in("v0") x);
|
||||||
|
//~^ ERROR can only be used as a clobber
|
||||||
|
//~| ERROR type `i32` cannot be used with this register class
|
||||||
|
asm!("", out("v0") x);
|
||||||
|
//~^ ERROR can only be used as a clobber
|
||||||
|
//~| ERROR type `i32` cannot be used with this register class
|
||||||
|
asm!("/* {} */", in(vreg) x);
|
||||||
|
//~^ ERROR can only be used as a clobber
|
||||||
|
//~| ERROR type `i32` cannot be used with this register class
|
||||||
|
asm!("/* {} */", out(vreg) _);
|
||||||
|
//~^ ERROR can only be used as a clobber
|
||||||
|
}
|
||||||
|
}
|
135
tests/ui/asm/s390x/bad-reg.rs
Normal file
135
tests/ui/asm/s390x/bad-reg.rs
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
//@ revisions: s390x
|
||||||
|
//@[s390x] compile-flags: --target s390x-unknown-linux-gnu
|
||||||
|
//@[s390x] needs-llvm-components: systemz
|
||||||
|
//@ needs-asm-support
|
||||||
|
|
||||||
|
#![crate_type = "rlib"]
|
||||||
|
#![feature(no_core, rustc_attrs, lang_items, asm_experimental_arch)]
|
||||||
|
#![no_core]
|
||||||
|
|
||||||
|
#[lang = "sized"]
|
||||||
|
trait Sized {}
|
||||||
|
#[lang = "copy"]
|
||||||
|
trait Copy {}
|
||||||
|
|
||||||
|
impl Copy for i32 {}
|
||||||
|
|
||||||
|
#[rustc_builtin_macro]
|
||||||
|
macro_rules! asm {
|
||||||
|
() => {};
|
||||||
|
}
|
||||||
|
|
||||||
|
fn f() {
|
||||||
|
let mut x = 0;
|
||||||
|
unsafe {
|
||||||
|
// Unsupported registers
|
||||||
|
asm!("", out("r11") _);
|
||||||
|
//~^ ERROR invalid register `r11`: The frame pointer cannot be used as an operand for inline asm
|
||||||
|
asm!("", out("r15") _);
|
||||||
|
//~^ ERROR invalid register `r15`: The stack pointer cannot be used as an operand for inline asm
|
||||||
|
asm!("", out("c0") _);
|
||||||
|
//~^ ERROR invalid register `c0`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
asm!("", out("c1") _);
|
||||||
|
//~^ ERROR invalid register `c1`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
asm!("", out("c2") _);
|
||||||
|
//~^ ERROR invalid register `c2`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
asm!("", out("c3") _);
|
||||||
|
//~^ ERROR invalid register `c3`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
asm!("", out("c4") _);
|
||||||
|
//~^ ERROR invalid register `c4`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
asm!("", out("c5") _);
|
||||||
|
//~^ ERROR invalid register `c5`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
asm!("", out("c6") _);
|
||||||
|
//~^ ERROR invalid register `c6`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
asm!("", out("c7") _);
|
||||||
|
//~^ ERROR invalid register `c7`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
asm!("", out("c8") _);
|
||||||
|
//~^ ERROR invalid register `c8`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
asm!("", out("c9") _);
|
||||||
|
//~^ ERROR invalid register `c9`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
asm!("", out("c10") _);
|
||||||
|
//~^ ERROR invalid register `c10`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
asm!("", out("c11") _);
|
||||||
|
//~^ ERROR invalid register `c11`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
asm!("", out("c12") _);
|
||||||
|
//~^ ERROR invalid register `c12`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
asm!("", out("c13") _);
|
||||||
|
//~^ ERROR invalid register `c13`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
asm!("", out("c14") _);
|
||||||
|
//~^ ERROR invalid register `c14`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
asm!("", out("c15") _);
|
||||||
|
//~^ ERROR invalid register `c15`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
asm!("", out("a0") _);
|
||||||
|
//~^ ERROR invalid register `a0`: a0 and a1 are reserved for system use and cannot be used as operands for inline asm
|
||||||
|
asm!("", out("a1") _);
|
||||||
|
//~^ ERROR invalid register `a1`: a0 and a1 are reserved for system use and cannot be used as operands for inline asm
|
||||||
|
|
||||||
|
// Clobber-only registers
|
||||||
|
// areg
|
||||||
|
asm!("", out("a2") _); // ok
|
||||||
|
asm!("", in("a2") x);
|
||||||
|
//~^ ERROR can only be used as a clobber
|
||||||
|
//~| ERROR type `i32` cannot be used with this register class
|
||||||
|
asm!("", out("a2") x);
|
||||||
|
//~^ ERROR can only be used as a clobber
|
||||||
|
//~| ERROR type `i32` cannot be used with this register class
|
||||||
|
asm!("/* {} */", in(areg) x);
|
||||||
|
//~^ ERROR can only be used as a clobber
|
||||||
|
//~| ERROR type `i32` cannot be used with this register class
|
||||||
|
asm!("/* {} */", out(areg) _);
|
||||||
|
//~^ ERROR can only be used as a clobber
|
||||||
|
|
||||||
|
// vreg
|
||||||
|
asm!("", out("v0") _); // ok
|
||||||
|
// FIXME: will be supported in https://github.com/rust-lang/rust/pull/131664
|
||||||
|
asm!("", in("v0") x);
|
||||||
|
//~^ ERROR can only be used as a clobber
|
||||||
|
//~| ERROR type `i32` cannot be used with this register class
|
||||||
|
asm!("", out("v0") x);
|
||||||
|
//~^ ERROR can only be used as a clobber
|
||||||
|
//~| ERROR type `i32` cannot be used with this register class
|
||||||
|
asm!("/* {} */", in(vreg) x);
|
||||||
|
//~^ ERROR can only be used as a clobber
|
||||||
|
//~| ERROR type `i32` cannot be used with this register class
|
||||||
|
asm!("/* {} */", out(vreg) _);
|
||||||
|
//~^ ERROR can only be used as a clobber
|
||||||
|
|
||||||
|
// Overlapping registers
|
||||||
|
// vreg/freg
|
||||||
|
asm!("", out("v0") _, out("f0") _);
|
||||||
|
//~^ ERROR register `f0` conflicts with register `v0`
|
||||||
|
asm!("", out("v1") _, out("f1") _);
|
||||||
|
//~^ ERROR register `f1` conflicts with register `v1`
|
||||||
|
asm!("", out("v2") _, out("f2") _);
|
||||||
|
//~^ ERROR register `f2` conflicts with register `v2`
|
||||||
|
asm!("", out("v3") _, out("f3") _);
|
||||||
|
//~^ ERROR register `f3` conflicts with register `v3`
|
||||||
|
asm!("", out("v4") _, out("f4") _);
|
||||||
|
//~^ ERROR register `f4` conflicts with register `v4`
|
||||||
|
asm!("", out("v5") _, out("f5") _);
|
||||||
|
//~^ ERROR register `f5` conflicts with register `v5`
|
||||||
|
asm!("", out("v6") _, out("f6") _);
|
||||||
|
//~^ ERROR register `f6` conflicts with register `v6`
|
||||||
|
asm!("", out("v7") _, out("f7") _);
|
||||||
|
//~^ ERROR register `f7` conflicts with register `v7`
|
||||||
|
asm!("", out("v8") _, out("f8") _);
|
||||||
|
//~^ ERROR register `f8` conflicts with register `v8`
|
||||||
|
asm!("", out("v9") _, out("f9") _);
|
||||||
|
//~^ ERROR register `f9` conflicts with register `v9`
|
||||||
|
asm!("", out("v10") _, out("f10") _);
|
||||||
|
//~^ ERROR register `f10` conflicts with register `v10`
|
||||||
|
asm!("", out("v11") _, out("f11") _);
|
||||||
|
//~^ ERROR register `f11` conflicts with register `v11`
|
||||||
|
asm!("", out("v12") _, out("f12") _);
|
||||||
|
//~^ ERROR register `f12` conflicts with register `v12`
|
||||||
|
asm!("", out("v13") _, out("f13") _);
|
||||||
|
//~^ ERROR register `f13` conflicts with register `v13`
|
||||||
|
asm!("", out("v14") _, out("f14") _);
|
||||||
|
//~^ ERROR register `f14` conflicts with register `v14`
|
||||||
|
asm!("", out("v15") _, out("f15") _);
|
||||||
|
//~^ ERROR register `f15` conflicts with register `v15`
|
||||||
|
// no %f16
|
||||||
|
asm!("", out("v16") _, out("f16") _);
|
||||||
|
//~^ ERROR invalid register `f16`: unknown register
|
||||||
|
}
|
||||||
|
}
|
352
tests/ui/asm/s390x/bad-reg.s390x.stderr
Normal file
352
tests/ui/asm/s390x/bad-reg.s390x.stderr
Normal file
@ -0,0 +1,352 @@
|
|||||||
|
error: invalid register `r11`: The frame pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:26:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("r11") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `r15`: The stack pointer cannot be used as an operand for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:28:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("r15") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `c0`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:30:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("c0") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `c1`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:32:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("c1") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `c2`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:34:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("c2") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `c3`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:36:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("c3") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `c4`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:38:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("c4") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `c5`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:40:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("c5") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `c6`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:42:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("c6") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `c7`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:44:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("c7") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `c8`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:46:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("c8") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `c9`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:48:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("c9") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `c10`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:50:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("c10") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `c11`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:52:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("c11") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `c12`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:54:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("c12") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `c13`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:56:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("c13") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `c14`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:58:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("c14") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `c15`: control registers are reserved by the kernel and cannot be used as operands for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:60:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("c15") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `a0`: a0 and a1 are reserved for system use and cannot be used as operands for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:62:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("a0") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: invalid register `a1`: a0 and a1 are reserved for system use and cannot be used as operands for inline asm
|
||||||
|
--> $DIR/bad-reg.rs:64:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("a1") _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `areg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:70:18
|
||||||
|
|
|
||||||
|
LL | asm!("", in("a2") x);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `areg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:73:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("a2") x);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `areg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:76:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(areg) x);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `areg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:79:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", out(areg) _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:85:18
|
||||||
|
|
|
||||||
|
LL | asm!("", in("v0") x);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:88:18
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v0") x);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:91:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(vreg) x);
|
||||||
|
| ^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register class `vreg` can only be used as a clobber, not as an input or output
|
||||||
|
--> $DIR/bad-reg.rs:94:26
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", out(vreg) _);
|
||||||
|
| ^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: register `f0` conflicts with register `v0`
|
||||||
|
--> $DIR/bad-reg.rs:99:31
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v0") _, out("f0") _);
|
||||||
|
| ----------- ^^^^^^^^^^^ register `f0`
|
||||||
|
| |
|
||||||
|
| register `v0`
|
||||||
|
|
||||||
|
error: register `f1` conflicts with register `v1`
|
||||||
|
--> $DIR/bad-reg.rs:101:31
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v1") _, out("f1") _);
|
||||||
|
| ----------- ^^^^^^^^^^^ register `f1`
|
||||||
|
| |
|
||||||
|
| register `v1`
|
||||||
|
|
||||||
|
error: register `f2` conflicts with register `v2`
|
||||||
|
--> $DIR/bad-reg.rs:103:31
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v2") _, out("f2") _);
|
||||||
|
| ----------- ^^^^^^^^^^^ register `f2`
|
||||||
|
| |
|
||||||
|
| register `v2`
|
||||||
|
|
||||||
|
error: register `f3` conflicts with register `v3`
|
||||||
|
--> $DIR/bad-reg.rs:105:31
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v3") _, out("f3") _);
|
||||||
|
| ----------- ^^^^^^^^^^^ register `f3`
|
||||||
|
| |
|
||||||
|
| register `v3`
|
||||||
|
|
||||||
|
error: register `f4` conflicts with register `v4`
|
||||||
|
--> $DIR/bad-reg.rs:107:31
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v4") _, out("f4") _);
|
||||||
|
| ----------- ^^^^^^^^^^^ register `f4`
|
||||||
|
| |
|
||||||
|
| register `v4`
|
||||||
|
|
||||||
|
error: register `f5` conflicts with register `v5`
|
||||||
|
--> $DIR/bad-reg.rs:109:31
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v5") _, out("f5") _);
|
||||||
|
| ----------- ^^^^^^^^^^^ register `f5`
|
||||||
|
| |
|
||||||
|
| register `v5`
|
||||||
|
|
||||||
|
error: register `f6` conflicts with register `v6`
|
||||||
|
--> $DIR/bad-reg.rs:111:31
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v6") _, out("f6") _);
|
||||||
|
| ----------- ^^^^^^^^^^^ register `f6`
|
||||||
|
| |
|
||||||
|
| register `v6`
|
||||||
|
|
||||||
|
error: register `f7` conflicts with register `v7`
|
||||||
|
--> $DIR/bad-reg.rs:113:31
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v7") _, out("f7") _);
|
||||||
|
| ----------- ^^^^^^^^^^^ register `f7`
|
||||||
|
| |
|
||||||
|
| register `v7`
|
||||||
|
|
||||||
|
error: register `f8` conflicts with register `v8`
|
||||||
|
--> $DIR/bad-reg.rs:115:31
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v8") _, out("f8") _);
|
||||||
|
| ----------- ^^^^^^^^^^^ register `f8`
|
||||||
|
| |
|
||||||
|
| register `v8`
|
||||||
|
|
||||||
|
error: register `f9` conflicts with register `v9`
|
||||||
|
--> $DIR/bad-reg.rs:117:31
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v9") _, out("f9") _);
|
||||||
|
| ----------- ^^^^^^^^^^^ register `f9`
|
||||||
|
| |
|
||||||
|
| register `v9`
|
||||||
|
|
||||||
|
error: register `f10` conflicts with register `v10`
|
||||||
|
--> $DIR/bad-reg.rs:119:32
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v10") _, out("f10") _);
|
||||||
|
| ------------ ^^^^^^^^^^^^ register `f10`
|
||||||
|
| |
|
||||||
|
| register `v10`
|
||||||
|
|
||||||
|
error: register `f11` conflicts with register `v11`
|
||||||
|
--> $DIR/bad-reg.rs:121:32
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v11") _, out("f11") _);
|
||||||
|
| ------------ ^^^^^^^^^^^^ register `f11`
|
||||||
|
| |
|
||||||
|
| register `v11`
|
||||||
|
|
||||||
|
error: register `f12` conflicts with register `v12`
|
||||||
|
--> $DIR/bad-reg.rs:123:32
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v12") _, out("f12") _);
|
||||||
|
| ------------ ^^^^^^^^^^^^ register `f12`
|
||||||
|
| |
|
||||||
|
| register `v12`
|
||||||
|
|
||||||
|
error: register `f13` conflicts with register `v13`
|
||||||
|
--> $DIR/bad-reg.rs:125:32
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v13") _, out("f13") _);
|
||||||
|
| ------------ ^^^^^^^^^^^^ register `f13`
|
||||||
|
| |
|
||||||
|
| register `v13`
|
||||||
|
|
||||||
|
error: register `f14` conflicts with register `v14`
|
||||||
|
--> $DIR/bad-reg.rs:127:32
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v14") _, out("f14") _);
|
||||||
|
| ------------ ^^^^^^^^^^^^ register `f14`
|
||||||
|
| |
|
||||||
|
| register `v14`
|
||||||
|
|
||||||
|
error: register `f15` conflicts with register `v15`
|
||||||
|
--> $DIR/bad-reg.rs:129:32
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v15") _, out("f15") _);
|
||||||
|
| ------------ ^^^^^^^^^^^^ register `f15`
|
||||||
|
| |
|
||||||
|
| register `v15`
|
||||||
|
|
||||||
|
error: invalid register `f16`: unknown register
|
||||||
|
--> $DIR/bad-reg.rs:132:32
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v16") _, out("f16") _);
|
||||||
|
| ^^^^^^^^^^^^
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:70:27
|
||||||
|
|
|
||||||
|
LL | asm!("", in("a2") x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `areg` supports these types:
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:73:28
|
||||||
|
|
|
||||||
|
LL | asm!("", out("a2") x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `areg` supports these types:
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:76:35
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(areg) x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `areg` supports these types:
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:85:27
|
||||||
|
|
|
||||||
|
LL | asm!("", in("v0") x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:88:28
|
||||||
|
|
|
||||||
|
LL | asm!("", out("v0") x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: type `i32` cannot be used with this register class
|
||||||
|
--> $DIR/bad-reg.rs:91:35
|
||||||
|
|
|
||||||
|
LL | asm!("/* {} */", in(vreg) x);
|
||||||
|
| ^
|
||||||
|
|
|
||||||
|
= note: register class `vreg` supports these types:
|
||||||
|
|
||||||
|
error: aborting due to 51 previous errors
|
||||||
|
|
Loading…
Reference in New Issue
Block a user