Skip to content

Commit 3e26830

Browse files
Rollup merge of #164665 - traviscross:TC/add-reference-annotations_inline-assembly, r=PLeVasseur,traviscross
Add Reference annotations for inline assembly Let's link the relevant UI tests to the Reference's rules for inline assembly.
2 parents 4bf1367 + 86ec59f commit 3e26830

56 files changed

Lines changed: 330 additions & 159 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎tests/ui/asm/aarch64/aarch64-sve.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ fn f(x: f64) {
1818
asm!("", out("ffr") _);
1919
}
2020
}
21+
22+
//@ reference: asm.register-operands.supported-register-classes

‎tests/ui/asm/aarch64/arm64ec-sve.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ fn f(x: f64) {
2121
//~^ ERROR cannot use register `ffr`
2222
}
2323
}
24+
25+
//@ reference: asm.register-names.not-for-io

‎tests/ui/asm/aarch64/bad-options.rs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,10 @@ global_asm!("", options(nostack));
4444
//~^ ERROR the `nostack` option cannot be used with `global_asm!`
4545
global_asm!("", options(preserves_flags));
4646
//~^ ERROR the `preserves_flags` option cannot be used with `global_asm!`
47+
48+
//@ reference: asm.abi-clobbers.must-specify
49+
//@ reference: asm.abi-clobbers.supported-abis
50+
//@ reference: asm.options.checks-mutually-exclusive
51+
//@ reference: asm.options.checks-noreturn
52+
//@ reference: asm.options.checks-pure
53+
//@ reference: asm.options.global_asm-restriction

‎tests/ui/asm/aarch64/bad-reg.rs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,11 @@ fn main() {
6363
asm!("", in("v0") foo, lateout("q0") bar);
6464
}
6565
}
66+
67+
//@ reference: asm.operand-type.supported-operands-lateout
68+
//@ reference: asm.register-names.not-for-io
69+
//@ reference: asm.register-operands.equivalence-to-base-register
70+
//@ reference: asm.register-operands.error-two-operands
71+
//@ reference: asm.register-operands.register-or-class
72+
//@ reference: asm.register-operands.supported-register-classes
73+
//@ reference: asm.template-modifiers.supported-modifiers

‎tests/ui/asm/aarch64/const.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ fn main() {
3838
global_asm!("mov x0, {}", const 5);
3939
global_asm!("mov x0, {}", const constfn(5));
4040
global_asm!("mov x0, {}", const constfn(5) + constfn(5));
41+
42+
//@ reference: asm.operand-type.supported-operands-const

‎tests/ui/asm/aarch64/llvm-58384.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ fn main() {
1414
}
1515
assert_eq!(a, 435);
1616
}
17+
18+
//@ reference: asm.operand-type.supported-operands-inout-arrow

‎tests/ui/asm/aarch64/parse-error.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ fn main() {
2424
//~^^ ERROR attempt to use a non-constant value in a constant
2525
}
2626
}
27+
28+
//@ reference: asm.ts-args.positional-first

‎tests/ui/asm/aarch64/srcloc.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,6 @@ fn main() {
134134
//~^^ ERROR: unrecognized instruction mnemonic
135135
}
136136
}
137+
138+
//@ reference: asm.ts-args.one-or-more
139+
//@ reference: asm.validity.non-exhaustive

‎tests/ui/asm/aarch64/sym.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,5 @@ fn main() {
8383
.join()
8484
.unwrap();
8585
}
86+
87+
//@ reference: asm.operand-type.supported-operands-sym

‎tests/ui/asm/aarch64/type-check-2-2.rs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@ fn main() {
3333
// Sym operands must point to a function or static
3434
}
3535
}
36+
37+
//@ reference: asm.operand-type.supported-operands-in
38+
//@ reference: asm.operand-type.supported-operands-inout
39+
//@ reference: asm.operand-type.supported-operands-out

0 commit comments

Comments
 (0)