Skip to content

Commit 61c233b

Browse files
committed
Remove ui tests for LLVM-style inline assembly
1 parent a76577c commit 61c233b

File tree

70 files changed

+74
-1500
lines changed

Some content is hidden

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

70 files changed

+74
-1500
lines changed

src/test/ui/asm/naked-functions.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
// ignore-spirv
44
// ignore-wasm32
55

6-
#![feature(llvm_asm)]
76
#![feature(naked_functions)]
87
#![feature(or_patterns)]
98
#![feature(asm_const, asm_sym)]
109
#![crate_type = "lib"]
11-
#![allow(deprecated)] // llvm_asm!
1210

1311
use std::arch::asm;
1412

@@ -114,16 +112,6 @@ pub fn outer(x: u32) -> extern "C" fn(usize) -> usize {
114112
inner
115113
}
116114

117-
#[naked]
118-
unsafe extern "C" fn llvm() -> ! {
119-
//~^ WARN naked functions must contain a single asm block
120-
//~| WARN this was previously accepted
121-
llvm_asm!("");
122-
//~^ WARN LLVM-style inline assembly is unsupported in naked functions
123-
//~| WARN this was previously accepted
124-
core::hint::unreachable_unchecked();
125-
}
126-
127115
#[naked]
128116
unsafe extern "C" fn invalid_options() {
129117
asm!("", options(nomem, preserves_flags, noreturn));

src/test/ui/asm/naked-functions.stderr

Lines changed: 32 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
error: asm with the `pure` option must have at least one output
2-
--> $DIR/naked-functions.rs:136:14
2+
--> $DIR/naked-functions.rs:124:14
33
|
44
LL | asm!("", options(readonly, nostack), options(pure));
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^
66

77
error: patterns not allowed in naked function parameters
8-
--> $DIR/naked-functions.rs:23:5
8+
--> $DIR/naked-functions.rs:21:5
99
|
1010
LL | mut a: u32,
1111
| ^^^^^
1212

1313
error: patterns not allowed in naked function parameters
14-
--> $DIR/naked-functions.rs:25:5
14+
--> $DIR/naked-functions.rs:23:5
1515
|
1616
LL | &b: &i32,
1717
| ^^
1818

1919
error: patterns not allowed in naked function parameters
20-
--> $DIR/naked-functions.rs:27:6
20+
--> $DIR/naked-functions.rs:25:6
2121
|
2222
LL | (None | Some(_)): Option<std::ptr::NonNull<u8>>,
2323
| ^^^^^^^^^^^^^^
2424

2525
error: patterns not allowed in naked function parameters
26-
--> $DIR/naked-functions.rs:29:5
26+
--> $DIR/naked-functions.rs:27:5
2727
|
2828
LL | P { x, y }: P,
2929
| ^^^^^^^^^^
3030

3131
error: referencing function parameters is not allowed in naked functions
32-
--> $DIR/naked-functions.rs:39:5
32+
--> $DIR/naked-functions.rs:37:5
3333
|
3434
LL | a + 1
3535
| ^
3636
|
3737
= help: follow the calling convention in asm block to use parameters
3838

3939
warning: naked functions must contain a single asm block
40-
--> $DIR/naked-functions.rs:36:1
40+
--> $DIR/naked-functions.rs:34:1
4141
|
4242
LL | / pub unsafe extern "C" fn inc(a: u32) -> u32 {
4343
LL | |
@@ -53,15 +53,15 @@ LL | | }
5353
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
5454

5555
error: referencing function parameters is not allowed in naked functions
56-
--> $DIR/naked-functions.rs:45:31
56+
--> $DIR/naked-functions.rs:43:31
5757
|
5858
LL | asm!("/* {0} */", in(reg) a, options(noreturn));
5959
| ^
6060
|
6161
= help: follow the calling convention in asm block to use parameters
6262

6363
warning: only `const` and `sym` operands are supported in naked functions
64-
--> $DIR/naked-functions.rs:45:23
64+
--> $DIR/naked-functions.rs:43:23
6565
|
6666
LL | asm!("/* {0} */", in(reg) a, options(noreturn));
6767
| ^^^^^^^^^
@@ -70,7 +70,7 @@ LL | asm!("/* {0} */", in(reg) a, options(noreturn));
7070
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
7171

7272
warning: naked functions must contain a single asm block
73-
--> $DIR/naked-functions.rs:52:1
73+
--> $DIR/naked-functions.rs:50:1
7474
|
7575
LL | / pub unsafe extern "C" fn inc_closure(a: u32) -> u32 {
7676
LL | |
@@ -84,7 +84,7 @@ LL | | }
8484
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
8585

8686
warning: only `const` and `sym` operands are supported in naked functions
87-
--> $DIR/naked-functions.rs:72:10
87+
--> $DIR/naked-functions.rs:70:10
8888
|
8989
LL | in(reg) a,
9090
| ^^^^^^^^^
@@ -102,7 +102,7 @@ LL | out(reg) e,
102102
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
103103

104104
warning: asm in naked functions must use `noreturn` option
105-
--> $DIR/naked-functions.rs:69:5
105+
--> $DIR/naked-functions.rs:67:5
106106
|
107107
LL | / asm!("/* {0} {1} {2} {3} {4} {5} {6} */",
108108
LL | |
@@ -117,7 +117,7 @@ LL | | );
117117
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
118118

119119
warning: naked functions must contain a single asm block
120-
--> $DIR/naked-functions.rs:59:1
120+
--> $DIR/naked-functions.rs:57:1
121121
|
122122
LL | / pub unsafe extern "C" fn unsupported_operands() {
123123
LL | |
@@ -141,7 +141,7 @@ LL | | }
141141
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
142142

143143
warning: naked functions must contain a single asm block
144-
--> $DIR/naked-functions.rs:85:1
144+
--> $DIR/naked-functions.rs:83:1
145145
|
146146
LL | / pub extern "C" fn missing_assembly() {
147147
LL | |
@@ -153,7 +153,7 @@ LL | | }
153153
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
154154

155155
warning: asm in naked functions must use `noreturn` option
156-
--> $DIR/naked-functions.rs:94:5
156+
--> $DIR/naked-functions.rs:92:5
157157
|
158158
LL | asm!("");
159159
| ^^^^^^^^
@@ -162,7 +162,7 @@ LL | asm!("");
162162
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
163163

164164
warning: asm in naked functions must use `noreturn` option
165-
--> $DIR/naked-functions.rs:97:5
165+
--> $DIR/naked-functions.rs:95:5
166166
|
167167
LL | asm!("");
168168
| ^^^^^^^^
@@ -171,7 +171,7 @@ LL | asm!("");
171171
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
172172

173173
warning: asm in naked functions must use `noreturn` option
174-
--> $DIR/naked-functions.rs:100:5
174+
--> $DIR/naked-functions.rs:98:5
175175
|
176176
LL | asm!("");
177177
| ^^^^^^^^
@@ -180,7 +180,7 @@ LL | asm!("");
180180
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
181181

182182
warning: naked functions must contain a single asm block
183-
--> $DIR/naked-functions.rs:91:1
183+
--> $DIR/naked-functions.rs:89:1
184184
|
185185
LL | / pub extern "C" fn too_many_asm_blocks() {
186186
LL | |
@@ -202,15 +202,15 @@ LL | | }
202202
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
203203

204204
error: referencing function parameters is not allowed in naked functions
205-
--> $DIR/naked-functions.rs:111:11
205+
--> $DIR/naked-functions.rs:109:11
206206
|
207207
LL | *&y
208208
| ^
209209
|
210210
= help: follow the calling convention in asm block to use parameters
211211

212212
warning: naked functions must contain a single asm block
213-
--> $DIR/naked-functions.rs:108:5
213+
--> $DIR/naked-functions.rs:106:5
214214
|
215215
LL | / pub extern "C" fn inner(y: usize) -> usize {
216216
LL | |
@@ -224,35 +224,8 @@ LL | | }
224224
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
225225
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
226226

227-
warning: the LLVM-style inline assembly is unsupported in naked functions
228-
--> $DIR/naked-functions.rs:121:5
229-
|
230-
LL | llvm_asm!("");
231-
| ^^^^^^^^^^^^^
232-
|
233-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
234-
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
235-
= help: use the new asm! syntax specified in RFC 2873
236-
= note: this warning originates in the macro `llvm_asm` (in Nightly builds, run with -Z macro-backtrace for more info)
237-
238-
warning: naked functions must contain a single asm block
239-
--> $DIR/naked-functions.rs:118:1
240-
|
241-
LL | / unsafe extern "C" fn llvm() -> ! {
242-
LL | |
243-
LL | |
244-
LL | | llvm_asm!("");
245-
... |
246-
LL | | core::hint::unreachable_unchecked();
247-
| | ------------------------------------ non-asm is unsupported in naked functions
248-
LL | | }
249-
| |_^
250-
|
251-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
252-
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
253-
254227
warning: asm options unsupported in naked functions: `nomem`, `preserves_flags`
255-
--> $DIR/naked-functions.rs:129:5
228+
--> $DIR/naked-functions.rs:117:5
256229
|
257230
LL | asm!("", options(nomem, preserves_flags, noreturn));
258231
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -261,7 +234,7 @@ LL | asm!("", options(nomem, preserves_flags, noreturn));
261234
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
262235

263236
warning: asm options unsupported in naked functions: `nostack`, `pure`, `readonly`
264-
--> $DIR/naked-functions.rs:136:5
237+
--> $DIR/naked-functions.rs:124:5
265238
|
266239
LL | asm!("", options(readonly, nostack), options(pure));
267240
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -270,7 +243,7 @@ LL | asm!("", options(readonly, nostack), options(pure));
270243
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
271244

272245
warning: asm in naked functions must use `noreturn` option
273-
--> $DIR/naked-functions.rs:136:5
246+
--> $DIR/naked-functions.rs:124:5
274247
|
275248
LL | asm!("", options(readonly, nostack), options(pure));
276249
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -279,21 +252,21 @@ LL | asm!("", options(readonly, nostack), options(pure));
279252
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
280253

281254
warning: Rust ABI is unsupported in naked functions
282-
--> $DIR/naked-functions.rs:145:15
255+
--> $DIR/naked-functions.rs:133:15
283256
|
284257
LL | pub unsafe fn default_abi() {
285258
| ^^^^^^^^^^^
286259
|
287260
= note: `#[warn(undefined_naked_function_abi)]` on by default
288261

289262
warning: Rust ABI is unsupported in naked functions
290-
--> $DIR/naked-functions.rs:151:15
263+
--> $DIR/naked-functions.rs:139:15
291264
|
292265
LL | pub unsafe fn rust_abi() {
293266
| ^^^^^^^^
294267

295268
warning: naked functions cannot be inlined
296-
--> $DIR/naked-functions.rs:191:1
269+
--> $DIR/naked-functions.rs:179:1
297270
|
298271
LL | #[inline]
299272
| ^^^^^^^^^
@@ -302,7 +275,7 @@ LL | #[inline]
302275
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
303276

304277
warning: naked functions cannot be inlined
305-
--> $DIR/naked-functions.rs:199:1
278+
--> $DIR/naked-functions.rs:187:1
306279
|
307280
LL | #[inline(always)]
308281
| ^^^^^^^^^^^^^^^^^
@@ -311,7 +284,7 @@ LL | #[inline(always)]
311284
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
312285

313286
warning: naked functions cannot be inlined
314-
--> $DIR/naked-functions.rs:207:1
287+
--> $DIR/naked-functions.rs:195:1
315288
|
316289
LL | #[inline(never)]
317290
| ^^^^^^^^^^^^^^^^
@@ -320,7 +293,7 @@ LL | #[inline(never)]
320293
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
321294

322295
warning: naked functions cannot be inlined
323-
--> $DIR/naked-functions.rs:215:1
296+
--> $DIR/naked-functions.rs:203:1
324297
|
325298
LL | #[inline]
326299
| ^^^^^^^^^
@@ -329,7 +302,7 @@ LL | #[inline]
329302
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
330303

331304
warning: naked functions cannot be inlined
332-
--> $DIR/naked-functions.rs:218:1
305+
--> $DIR/naked-functions.rs:206:1
333306
|
334307
LL | #[inline(always)]
335308
| ^^^^^^^^^^^^^^^^^
@@ -338,13 +311,13 @@ LL | #[inline(always)]
338311
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
339312

340313
warning: naked functions cannot be inlined
341-
--> $DIR/naked-functions.rs:221:1
314+
--> $DIR/naked-functions.rs:209:1
342315
|
343316
LL | #[inline(never)]
344317
| ^^^^^^^^^^^^^^^^
345318
|
346319
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
347320
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
348321

349-
error: aborting due to 8 previous errors; 25 warnings emitted
322+
error: aborting due to 8 previous errors; 23 warnings emitted
350323

src/test/ui/ast-json/ast-json-ice.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
// check-pass
99
// dont-check-compiler-stdout - don't check for any AST change.
1010

11-
#![feature(llvm_asm)]
12-
#![allow(deprecated)] // llvm_asm!
13-
1411
enum V {
1512
A(i32),
1613
B { f: [i64; 3 + 4] }
@@ -27,12 +24,6 @@ macro_rules! call_println {
2724
}
2825

2926
fn main() {
30-
#[cfg(any(target_arch = "x86",
31-
target_arch = "x86_64",
32-
target_arch = "arm",
33-
target_arch = "aarch64"))]
34-
unsafe { llvm_asm!(""::::); }
35-
3627
let x: (i32) = 35;
3728
let y = x as i64<> + 5;
3829

0 commit comments

Comments
 (0)