diff options
| author | Amanieu d'Antras <amanieu@gmail.com> | 2021-06-24 16:25:44 +0100 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2021-06-24 23:42:15 +0100 |
| commit | d0443bb7c2c42d03e7a329e2e18eef779bd2e0e9 (patch) | |
| tree | baec681a45de19b8b31ef187b89e0ed1119911a3 /src/test | |
| parent | 1e13a9bb33debb931d603278b7f1a706b0d11660 (diff) | |
| download | rust-d0443bb7c2c42d03e7a329e2e18eef779bd2e0e9.tar.gz rust-d0443bb7c2c42d03e7a329e2e18eef779bd2e0e9.zip | |
Add a "raw" option for asm! which ignores format string specifiers
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/codegen/asm-options.rs | 7 | ||||
| -rw-r--r-- | src/test/ui/asm/bad-options.stderr | 24 | ||||
| -rw-r--r-- | src/test/ui/asm/parse-error.stderr | 20 |
3 files changed, 29 insertions, 22 deletions
diff --git a/src/test/codegen/asm-options.rs b/src/test/codegen/asm-options.rs index 70391661b0c..28df0f9b852 100644 --- a/src/test/codegen/asm-options.rs +++ b/src/test/codegen/asm-options.rs @@ -94,3 +94,10 @@ pub unsafe fn dont_remove_nonpure() { asm!("", options(nomem)); asm!("", options(readonly)); } + +// CHECK-LABEL: @raw +// CHECK: call void asm sideeffect inteldialect "{} {}", ""() +#[no_mangle] +pub unsafe fn raw() { + asm!("{} {}", options(nostack, nomem, preserves_flags, raw)); +} diff --git a/src/test/ui/asm/bad-options.stderr b/src/test/ui/asm/bad-options.stderr index 4e27a6e2cb5..9039483be4b 100644 --- a/src/test/ui/asm/bad-options.stderr +++ b/src/test/ui/asm/bad-options.stderr @@ -28,41 +28,41 @@ error: asm outputs are not allowed with the `noreturn` option LL | asm!("{}", out(reg) foo, options(noreturn)); | ^^^^^^^^^^^^ -error: expected one of `)` or `att_syntax`, found `nomem` +error: expected one of `)`, `att_syntax`, or `raw`, found `nomem` --> $DIR/bad-options.rs:20:25 | LL | global_asm!("", options(nomem)); - | ^^^^^ expected one of `)` or `att_syntax` + | ^^^^^ expected one of `)`, `att_syntax`, or `raw` -error: expected one of `)` or `att_syntax`, found `readonly` +error: expected one of `)`, `att_syntax`, or `raw`, found `readonly` --> $DIR/bad-options.rs:22:25 | LL | global_asm!("", options(readonly)); - | ^^^^^^^^ expected one of `)` or `att_syntax` + | ^^^^^^^^ expected one of `)`, `att_syntax`, or `raw` -error: expected one of `)` or `att_syntax`, found `noreturn` +error: expected one of `)`, `att_syntax`, or `raw`, found `noreturn` --> $DIR/bad-options.rs:24:25 | LL | global_asm!("", options(noreturn)); - | ^^^^^^^^ expected one of `)` or `att_syntax` + | ^^^^^^^^ expected one of `)`, `att_syntax`, or `raw` -error: expected one of `)` or `att_syntax`, found `pure` +error: expected one of `)`, `att_syntax`, or `raw`, found `pure` --> $DIR/bad-options.rs:26:25 | LL | global_asm!("", options(pure)); - | ^^^^ expected one of `)` or `att_syntax` + | ^^^^ expected one of `)`, `att_syntax`, or `raw` -error: expected one of `)` or `att_syntax`, found `nostack` +error: expected one of `)`, `att_syntax`, or `raw`, found `nostack` --> $DIR/bad-options.rs:28:25 | LL | global_asm!("", options(nostack)); - | ^^^^^^^ expected one of `)` or `att_syntax` + | ^^^^^^^ expected one of `)`, `att_syntax`, or `raw` -error: expected one of `)` or `att_syntax`, found `preserves_flags` +error: expected one of `)`, `att_syntax`, or `raw`, found `preserves_flags` --> $DIR/bad-options.rs:30:25 | LL | global_asm!("", options(preserves_flags)); - | ^^^^^^^^^^^^^^^ expected one of `)` or `att_syntax` + | ^^^^^^^^^^^^^^^ expected one of `)`, `att_syntax`, or `raw` error: aborting due to 11 previous errors diff --git a/src/test/ui/asm/parse-error.stderr b/src/test/ui/asm/parse-error.stderr index afd262b851c..33dca61dc8e 100644 --- a/src/test/ui/asm/parse-error.stderr +++ b/src/test/ui/asm/parse-error.stderr @@ -64,11 +64,11 @@ error: argument to `sym` must be a path expression LL | asm!("{}", sym foo + bar); | ^^^^^^^^^ -error: expected one of `)`, `att_syntax`, `nomem`, `noreturn`, `nostack`, `preserves_flags`, `pure`, or `readonly`, found `foo` +error: expected one of `)`, `att_syntax`, `nomem`, `noreturn`, `nostack`, `preserves_flags`, `pure`, `raw`, or `readonly`, found `foo` --> $DIR/parse-error.rs:31:26 | LL | asm!("", options(foo)); - | ^^^ expected one of 8 possible tokens + | ^^^ expected one of 9 possible tokens error: expected one of `)` or `,`, found `foo` --> $DIR/parse-error.rs:33:32 @@ -76,11 +76,11 @@ error: expected one of `)` or `,`, found `foo` LL | asm!("", options(nomem foo)); | ^^^ expected one of `)` or `,` -error: expected one of `)`, `att_syntax`, `nomem`, `noreturn`, `nostack`, `preserves_flags`, `pure`, or `readonly`, found `foo` +error: expected one of `)`, `att_syntax`, `nomem`, `noreturn`, `nostack`, `preserves_flags`, `pure`, `raw`, or `readonly`, found `foo` --> $DIR/parse-error.rs:35:33 | LL | asm!("", options(nomem, foo)); - | ^^^ expected one of 8 possible tokens + | ^^^ expected one of 9 possible tokens error: arguments are not allowed after options --> $DIR/parse-error.rs:37:31 @@ -200,23 +200,23 @@ error: expected one of `,`, `.`, `?`, or an operator, found `FOO` LL | global_asm!("{}", const(reg) FOO); | ^^^ expected one of `,`, `.`, `?`, or an operator -error: expected one of `)` or `att_syntax`, found `FOO` +error: expected one of `)`, `att_syntax`, or `raw`, found `FOO` --> $DIR/parse-error.rs:81:25 | LL | global_asm!("", options(FOO)); - | ^^^ expected one of `)` or `att_syntax` + | ^^^ expected one of `)`, `att_syntax`, or `raw` -error: expected one of `)` or `att_syntax`, found `nomem` +error: expected one of `)`, `att_syntax`, or `raw`, found `nomem` --> $DIR/parse-error.rs:83:25 | LL | global_asm!("", options(nomem FOO)); - | ^^^^^ expected one of `)` or `att_syntax` + | ^^^^^ expected one of `)`, `att_syntax`, or `raw` -error: expected one of `)` or `att_syntax`, found `nomem` +error: expected one of `)`, `att_syntax`, or `raw`, found `nomem` --> $DIR/parse-error.rs:85:25 | LL | global_asm!("", options(nomem, FOO)); - | ^^^^^ expected one of `)` or `att_syntax` + | ^^^^^ expected one of `)`, `att_syntax`, or `raw` error: arguments are not allowed after options --> $DIR/parse-error.rs:87:30 |
