Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a33cae6

Browse files
committedAug 17, 2024··
Pass end position of span through inline ASM cookie
1 parent 569d7e3 commit a33cae6

File tree

18 files changed

+880
-115
lines changed

18 files changed

+880
-115
lines changed
 

‎compiler/rustc_codegen_llvm/src/asm.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -487,14 +487,11 @@ pub(crate) fn inline_asm_call<'ll>(
487487
let key = "srcloc";
488488
let kind = llvm::LLVMGetMDKindIDInContext(
489489
bx.llcx,
490-
key.as_ptr() as *const c_char,
490+
key.as_ptr().cast::<c_char>(),
491491
key.len() as c_uint,
492492
);
493493

494-
// srcloc contains one integer for each line of assembly code.
495-
// Unfortunately this isn't enough to encode a full span so instead
496-
// we just encode the start position of each line.
497-
// FIXME: Figure out a way to pass the entire line spans.
494+
// `srcloc` contains one 64-bit integer for each line of assembly code.
498495
let mut srcloc = vec![];
499496
if dia == llvm::AsmDialect::Intel && line_spans.len() > 1 {
500497
// LLVM inserts an extra line to add the ".intel_syntax", so add
@@ -504,9 +501,11 @@ pub(crate) fn inline_asm_call<'ll>(
504501
// due to the asm template string coming from a macro. LLVM will
505502
// default to the first srcloc for lines that don't have an
506503
// associated srcloc.
507-
srcloc.push(bx.const_i32(0));
504+
srcloc.push(bx.const_u64(0));
508505
}
509-
srcloc.extend(line_spans.iter().map(|span| bx.const_i32(span.lo().to_u32() as i32)));
506+
srcloc.extend(line_spans.iter().map(|span| {
507+
bx.const_u64(u64::from(span.lo().to_u32()) | (u64::from(span.hi().to_u32()) << 32))
508+
}));
510509
let md = llvm::LLVMMDNodeInContext(bx.llcx, srcloc.as_ptr(), srcloc.len() as u32);
511510
llvm::LLVMSetMetadata(call, kind, md);
512511

‎compiler/rustc_codegen_llvm/src/back/write.rs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use rustc_session::config::{
2525
};
2626
use rustc_session::Session;
2727
use rustc_span::symbol::sym;
28-
use rustc_span::InnerSpan;
28+
use rustc_span::{BytePos, InnerSpan, Pos, SpanData, SyntaxContext};
2929
use rustc_target::spec::{CodeModel, RelocModel, SanitizerSet, SplitDebuginfo, TlsModel};
3030
use tracing::debug;
3131

@@ -406,21 +406,32 @@ fn report_inline_asm(
406406
cgcx: &CodegenContext<LlvmCodegenBackend>,
407407
msg: String,
408408
level: llvm::DiagnosticLevel,
409-
mut cookie: u64,
409+
cookie: u64,
410410
source: Option<(String, Vec<InnerSpan>)>,
411411
) {
412412
// In LTO build we may get srcloc values from other crates which are invalid
413413
// since they use a different source map. To be safe we just suppress these
414414
// in LTO builds.
415-
if matches!(cgcx.lto, Lto::Fat | Lto::Thin) {
416-
cookie = 0;
417-
}
415+
let span = if cookie == 0 || matches!(cgcx.lto, Lto::Fat | Lto::Thin) {
416+
SpanData::default()
417+
} else {
418+
let lo = BytePos::from_u32(cookie as u32);
419+
let hi = BytePos::from_u32((cookie >> 32) as u32);
420+
// LLVM version < 19 silently truncates the cookie to 32 bits in some situations.
421+
SpanData {
422+
lo,
423+
hi: if hi.to_u32() != 0 { hi } else { lo },
424+
ctxt: SyntaxContext::root(),
425+
parent: None,
426+
}
427+
};
418428
let level = match level {
419429
llvm::DiagnosticLevel::Error => Level::Error,
420430
llvm::DiagnosticLevel::Warning => Level::Warning,
421431
llvm::DiagnosticLevel::Note | llvm::DiagnosticLevel::Remark => Level::Note,
422432
};
423-
cgcx.diag_emitter.inline_asm_error(cookie.try_into().unwrap(), msg, level, source);
433+
let msg = msg.strip_prefix("error: ").unwrap_or(&msg).to_string();
434+
cgcx.diag_emitter.inline_asm_error(span, msg, level, source);
424435
}
425436

426437
unsafe extern "C" fn diagnostic_handler(info: &DiagnosticInfo, user: *mut c_void) {

‎compiler/rustc_codegen_llvm/src/llvm/diagnostic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ impl InlineAsmDiagnostic {
151151
unsafe { SrcMgrDiagnostic::unpack(super::LLVMRustGetSMDiagnostic(di, &mut cookie)) };
152152
InlineAsmDiagnostic {
153153
level: smdiag.level,
154-
cookie: cookie.into(),
154+
cookie,
155155
message: smdiag.message,
156156
source: smdiag.source,
157157
}

‎compiler/rustc_codegen_llvm/src/llvm/ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2293,7 +2293,7 @@ extern "C" {
22932293

22942294
pub fn LLVMRustGetSMDiagnostic<'a>(
22952295
DI: &'a DiagnosticInfo,
2296-
cookie_out: &mut c_uint,
2296+
cookie_out: &mut u64,
22972297
) -> &'a SMDiagnostic;
22982298

22992299
#[allow(improper_ctypes)]

‎compiler/rustc_codegen_ssa/src/back/write.rs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use rustc_session::config::{
3535
use rustc_session::Session;
3636
use rustc_span::source_map::SourceMap;
3737
use rustc_span::symbol::sym;
38-
use rustc_span::{BytePos, FileName, InnerSpan, Pos, Span};
38+
use rustc_span::{FileName, InnerSpan, Span, SpanData};
3939
use rustc_target::spec::{MergeFunctions, SanitizerSet};
4040
use tracing::debug;
4141

@@ -1851,7 +1851,7 @@ fn spawn_work<'a, B: ExtraBackendMethods>(
18511851

18521852
enum SharedEmitterMessage {
18531853
Diagnostic(Diagnostic),
1854-
InlineAsmError(u32, String, Level, Option<(String, Vec<InnerSpan>)>),
1854+
InlineAsmError(SpanData, String, Level, Option<(String, Vec<InnerSpan>)>),
18551855
Fatal(String),
18561856
}
18571857

@@ -1873,12 +1873,12 @@ impl SharedEmitter {
18731873

18741874
pub fn inline_asm_error(
18751875
&self,
1876-
cookie: u32,
1876+
span: SpanData,
18771877
msg: String,
18781878
level: Level,
18791879
source: Option<(String, Vec<InnerSpan>)>,
18801880
) {
1881-
drop(self.sender.send(SharedEmitterMessage::InlineAsmError(cookie, msg, level, source)));
1881+
drop(self.sender.send(SharedEmitterMessage::InlineAsmError(span, msg, level, source)));
18821882
}
18831883

18841884
pub fn fatal(&self, msg: &str) {
@@ -1963,17 +1963,12 @@ impl SharedEmitterMain {
19631963
dcx.emit_diagnostic(d);
19641964
sess.dcx().abort_if_errors();
19651965
}
1966-
Ok(SharedEmitterMessage::InlineAsmError(cookie, msg, level, source)) => {
1966+
Ok(SharedEmitterMessage::InlineAsmError(span, msg, level, source)) => {
19671967
assert_matches!(level, Level::Error | Level::Warning | Level::Note);
1968-
let msg = msg.strip_prefix("error: ").unwrap_or(&msg).to_string();
19691968
let mut err = Diag::<()>::new(sess.dcx(), level, msg);
1970-
1971-
// If the cookie is 0 then we don't have span information.
1972-
if cookie != 0 {
1973-
let pos = BytePos::from_u32(cookie);
1974-
let span = Span::with_root_ctxt(pos, pos);
1975-
err.span(span);
1976-
};
1969+
if !span.is_dummy() {
1970+
err.span(span.span());
1971+
}
19771972

19781973
// Point to the generated assembly if it is available.
19791974
if let Some((buffer, spans)) = source {

‎compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,7 @@ extern "C" LLVMTypeKind LLVMRustGetTypeKind(LLVMTypeRef Ty) {
14531453
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(SMDiagnostic, LLVMSMDiagnosticRef)
14541454

14551455
extern "C" LLVMSMDiagnosticRef LLVMRustGetSMDiagnostic(LLVMDiagnosticInfoRef DI,
1456-
unsigned *Cookie) {
1456+
uint64_t *Cookie) {
14571457
llvm::DiagnosticInfoSrcMgr *SM =
14581458
static_cast<llvm::DiagnosticInfoSrcMgr *>(unwrap(DI));
14591459
*Cookie = SM->getLocCookie();

‎compiler/rustc_span/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,12 @@ impl SpanData {
519519
}
520520
}
521521

522+
impl Default for SpanData {
523+
fn default() -> Self {
524+
Self { lo: BytePos(0), hi: BytePos(0), ctxt: SyntaxContext::root(), parent: None }
525+
}
526+
}
527+
522528
// The interner is pointed to by a thread local value which is only set on the main thread
523529
// with parallelization is disabled. So we don't allow `Span` to transfer between threads
524530
// to avoid panics and other errors, even though it would be memory safe to do so.
Lines changed: 320 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,320 @@
1+
error: unrecognized instruction mnemonic
2+
--> $DIR/srcloc.rs:15:15
3+
|
4+
LL | asm!("invalid_instruction");
5+
| ^^^^^^^^^^^^^^^^^^^
6+
|
7+
note: instantiated into assembly here
8+
--> <inline asm>:1:2
9+
|
10+
LL | invalid_instruction
11+
| ^
12+
13+
error: unrecognized instruction mnemonic
14+
--> $DIR/srcloc.rs:19:13
15+
|
16+
LL | invalid_instruction
17+
| ^^^^^^^^^^^^^^^^^^^
18+
|
19+
note: instantiated into assembly here
20+
--> <inline asm>:2:13
21+
|
22+
LL | invalid_instruction
23+
| ^
24+
25+
error: unrecognized instruction mnemonic
26+
--> $DIR/srcloc.rs:24:13
27+
|
28+
LL | invalid_instruction
29+
| ^^^^^^^^^^^^^^^^^^^
30+
|
31+
note: instantiated into assembly here
32+
--> <inline asm>:2:13
33+
|
34+
LL | invalid_instruction
35+
| ^
36+
37+
error: unrecognized instruction mnemonic
38+
--> $DIR/srcloc.rs:30:13
39+
|
40+
LL | invalid_instruction
41+
| ^^^^^^^^^^^^^^^^^^^
42+
|
43+
note: instantiated into assembly here
44+
--> <inline asm>:3:13
45+
|
46+
LL | invalid_instruction
47+
| ^
48+
49+
error: unrecognized instruction mnemonic
50+
--> $DIR/srcloc.rs:37:13
51+
|
52+
LL | invalid_instruction
53+
| ^^^^^^^^^^^^^^^^^^^
54+
|
55+
note: instantiated into assembly here
56+
--> <inline asm>:3:13
57+
|
58+
LL | invalid_instruction
59+
| ^
60+
61+
error: unrecognized instruction mnemonic
62+
--> $DIR/srcloc.rs:42:14
63+
|
64+
LL | asm!(concat!("invalid", "_", "instruction"));
65+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66+
|
67+
note: instantiated into assembly here
68+
--> <inline asm>:1:2
69+
|
70+
LL | invalid_instruction
71+
| ^
72+
73+
error: unrecognized instruction mnemonic
74+
--> $DIR/srcloc.rs:46:14
75+
|
76+
LL | "invalid_instruction",
77+
| ^^^^^^^^^^^^^^^^^^^
78+
|
79+
note: instantiated into assembly here
80+
--> <inline asm>:1:2
81+
|
82+
LL | invalid_instruction
83+
| ^
84+
85+
error: unrecognized instruction mnemonic
86+
--> $DIR/srcloc.rs:52:14
87+
|
88+
LL | "invalid_instruction",
89+
| ^^^^^^^^^^^^^^^^^^^
90+
|
91+
note: instantiated into assembly here
92+
--> <inline asm>:2:1
93+
|
94+
LL | invalid_instruction
95+
| ^
96+
97+
error: unrecognized instruction mnemonic
98+
--> $DIR/srcloc.rs:59:14
99+
|
100+
LL | "invalid_instruction",
101+
| ^^^^^^^^^^^^^^^^^^^
102+
|
103+
note: instantiated into assembly here
104+
--> <inline asm>:3:1
105+
|
106+
LL | invalid_instruction
107+
| ^
108+
109+
error: unrecognized instruction mnemonic
110+
--> $DIR/srcloc.rs:66:13
111+
|
112+
LL | concat!("invalid", "_", "instruction"),
113+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
114+
|
115+
note: instantiated into assembly here
116+
--> <inline asm>:2:1
117+
|
118+
LL | invalid_instruction
119+
| ^
120+
121+
error: unrecognized instruction mnemonic
122+
--> $DIR/srcloc.rs:73:13
123+
|
124+
LL | concat!("invalid", "_", "instruction"),
125+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
126+
|
127+
note: instantiated into assembly here
128+
--> <inline asm>:2:1
129+
|
130+
LL | invalid_instruction
131+
| ^
132+
133+
error: unrecognized instruction mnemonic
134+
--> $DIR/srcloc.rs:80:14
135+
|
136+
LL | "invalid_instruction1",
137+
| ^^^^^^^^^^^^^^^^^^^^
138+
|
139+
note: instantiated into assembly here
140+
--> <inline asm>:1:2
141+
|
142+
LL | invalid_instruction1
143+
| ^
144+
145+
error: unrecognized instruction mnemonic
146+
--> $DIR/srcloc.rs:81:14
147+
|
148+
LL | "invalid_instruction2",
149+
| ^^^^^^^^^^^^^^^^^^^^
150+
|
151+
note: instantiated into assembly here
152+
--> <inline asm>:2:1
153+
|
154+
LL | invalid_instruction2
155+
| ^
156+
157+
error: unrecognized instruction mnemonic
158+
--> $DIR/srcloc.rs:87:13
159+
|
160+
LL | / concat!(
161+
LL | | "invalid", "_", "instruction1", "\n",
162+
LL | | "invalid", "_", "instruction2",
163+
LL | | ),
164+
| |_____________^
165+
|
166+
note: instantiated into assembly here
167+
--> <inline asm>:1:2
168+
|
169+
LL | invalid_instruction1
170+
| ^
171+
172+
error: unrecognized instruction mnemonic
173+
--> $DIR/srcloc.rs:87:13
174+
|
175+
LL | / concat!(
176+
LL | | "invalid", "_", "instruction1", "\n",
177+
LL | | "invalid", "_", "instruction2",
178+
LL | | ),
179+
| |_____________^
180+
|
181+
note: instantiated into assembly here
182+
--> <inline asm>:2:1
183+
|
184+
LL | invalid_instruction2
185+
| ^
186+
187+
error: unrecognized instruction mnemonic
188+
--> $DIR/srcloc.rs:96:13
189+
|
190+
LL | / concat!(
191+
LL | | "invalid", "_", "instruction1", "\n",
192+
LL | | "invalid", "_", "instruction2",
193+
LL | | ),
194+
| |_____________^
195+
|
196+
note: instantiated into assembly here
197+
--> <inline asm>:1:2
198+
|
199+
LL | invalid_instruction1
200+
| ^
201+
202+
error: unrecognized instruction mnemonic
203+
--> $DIR/srcloc.rs:96:13
204+
|
205+
LL | / concat!(
206+
LL | | "invalid", "_", "instruction1", "\n",
207+
LL | | "invalid", "_", "instruction2",
208+
LL | | ),
209+
| |_____________^
210+
|
211+
note: instantiated into assembly here
212+
--> <inline asm>:2:1
213+
|
214+
LL | invalid_instruction2
215+
| ^
216+
217+
error: unrecognized instruction mnemonic
218+
--> $DIR/srcloc.rs:100:13
219+
|
220+
LL | / concat!(
221+
LL | | "invalid", "_", "instruction3", "\n",
222+
LL | | "invalid", "_", "instruction4",
223+
LL | | ),
224+
| |_____________^
225+
|
226+
note: instantiated into assembly here
227+
--> <inline asm>:3:1
228+
|
229+
LL | invalid_instruction3
230+
| ^
231+
232+
error: unrecognized instruction mnemonic
233+
--> $DIR/srcloc.rs:100:13
234+
|
235+
LL | / concat!(
236+
LL | | "invalid", "_", "instruction3", "\n",
237+
LL | | "invalid", "_", "instruction4",
238+
LL | | ),
239+
| |_____________^
240+
|
241+
note: instantiated into assembly here
242+
--> <inline asm>:4:1
243+
|
244+
LL | invalid_instruction4
245+
| ^
246+
247+
error: unrecognized instruction mnemonic
248+
--> $DIR/srcloc.rs:111:13
249+
|
250+
LL | / concat!(
251+
LL | | "invalid", "_", "instruction1", "\n",
252+
LL | | "invalid", "_", "instruction2", "\n",
253+
LL | | ),
254+
| |_____________^
255+
|
256+
note: instantiated into assembly here
257+
--> <inline asm>:1:2
258+
|
259+
LL | invalid_instruction1
260+
| ^
261+
262+
error: unrecognized instruction mnemonic
263+
--> $DIR/srcloc.rs:111:13
264+
|
265+
LL | / concat!(
266+
LL | | "invalid", "_", "instruction1", "\n",
267+
LL | | "invalid", "_", "instruction2", "\n",
268+
LL | | ),
269+
| |_____________^
270+
|
271+
note: instantiated into assembly here
272+
--> <inline asm>:2:1
273+
|
274+
LL | invalid_instruction2
275+
| ^
276+
277+
error: unrecognized instruction mnemonic
278+
--> $DIR/srcloc.rs:115:13
279+
|
280+
LL | / concat!(
281+
LL | | "invalid", "_", "instruction3", "\n",
282+
LL | | "invalid", "_", "instruction4", "\n",
283+
LL | | ),
284+
| |_____________^
285+
|
286+
note: instantiated into assembly here
287+
--> <inline asm>:4:1
288+
|
289+
LL | invalid_instruction3
290+
| ^
291+
292+
error: unrecognized instruction mnemonic
293+
--> $DIR/srcloc.rs:115:13
294+
|
295+
LL | / concat!(
296+
LL | | "invalid", "_", "instruction3", "\n",
297+
LL | | "invalid", "_", "instruction4", "\n",
298+
LL | | ),
299+
| |_____________^
300+
|
301+
note: instantiated into assembly here
302+
--> <inline asm>:5:1
303+
|
304+
LL | invalid_instruction4
305+
| ^
306+
307+
error: unrecognized instruction mnemonic
308+
--> $DIR/srcloc.rs:128:14
309+
|
310+
LL | "invalid_instruction"
311+
| ^^^^^^^^^^^^^^^^^^^
312+
|
313+
note: instantiated into assembly here
314+
--> <inline asm>:4:1
315+
|
316+
LL | invalid_instruction
317+
| ^
318+
319+
error: aborting due to 24 previous errors
320+

‎tests/ui/asm/aarch64/srcloc.stderr renamed to ‎tests/ui/asm/aarch64/srcloc.old.stderr

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: unrecognized instruction mnemonic
2-
--> $DIR/srcloc.rs:12:15
2+
--> $DIR/srcloc.rs:15:15
33
|
44
LL | asm!("invalid_instruction");
55
| ^
@@ -11,7 +11,7 @@ LL | invalid_instruction
1111
| ^
1212

1313
error: unrecognized instruction mnemonic
14-
--> $DIR/srcloc.rs:16:13
14+
--> $DIR/srcloc.rs:19:13
1515
|
1616
LL | invalid_instruction
1717
| ^
@@ -23,7 +23,7 @@ LL | invalid_instruction
2323
| ^
2424

2525
error: unrecognized instruction mnemonic
26-
--> $DIR/srcloc.rs:21:13
26+
--> $DIR/srcloc.rs:24:13
2727
|
2828
LL | invalid_instruction
2929
| ^
@@ -35,7 +35,7 @@ LL | invalid_instruction
3535
| ^
3636

3737
error: unrecognized instruction mnemonic
38-
--> $DIR/srcloc.rs:27:13
38+
--> $DIR/srcloc.rs:30:13
3939
|
4040
LL | invalid_instruction
4141
| ^
@@ -47,7 +47,7 @@ LL | invalid_instruction
4747
| ^
4848

4949
error: unrecognized instruction mnemonic
50-
--> $DIR/srcloc.rs:34:13
50+
--> $DIR/srcloc.rs:37:13
5151
|
5252
LL | invalid_instruction
5353
| ^
@@ -59,7 +59,7 @@ LL | invalid_instruction
5959
| ^
6060

6161
error: unrecognized instruction mnemonic
62-
--> $DIR/srcloc.rs:39:14
62+
--> $DIR/srcloc.rs:42:14
6363
|
6464
LL | asm!(concat!("invalid", "_", "instruction"));
6565
| ^
@@ -71,7 +71,7 @@ LL | invalid_instruction
7171
| ^
7272

7373
error: unrecognized instruction mnemonic
74-
--> $DIR/srcloc.rs:43:14
74+
--> $DIR/srcloc.rs:46:14
7575
|
7676
LL | "invalid_instruction",
7777
| ^
@@ -83,7 +83,7 @@ LL | invalid_instruction
8383
| ^
8484

8585
error: unrecognized instruction mnemonic
86-
--> $DIR/srcloc.rs:49:14
86+
--> $DIR/srcloc.rs:52:14
8787
|
8888
LL | "invalid_instruction",
8989
| ^
@@ -95,7 +95,7 @@ LL | invalid_instruction
9595
| ^
9696

9797
error: unrecognized instruction mnemonic
98-
--> $DIR/srcloc.rs:56:14
98+
--> $DIR/srcloc.rs:59:14
9999
|
100100
LL | "invalid_instruction",
101101
| ^
@@ -107,7 +107,7 @@ LL | invalid_instruction
107107
| ^
108108

109109
error: unrecognized instruction mnemonic
110-
--> $DIR/srcloc.rs:63:13
110+
--> $DIR/srcloc.rs:66:13
111111
|
112112
LL | concat!("invalid", "_", "instruction"),
113113
| ^
@@ -119,7 +119,7 @@ LL | invalid_instruction
119119
| ^
120120

121121
error: unrecognized instruction mnemonic
122-
--> $DIR/srcloc.rs:70:13
122+
--> $DIR/srcloc.rs:73:13
123123
|
124124
LL | concat!("invalid", "_", "instruction"),
125125
| ^
@@ -131,7 +131,7 @@ LL | invalid_instruction
131131
| ^
132132

133133
error: unrecognized instruction mnemonic
134-
--> $DIR/srcloc.rs:77:14
134+
--> $DIR/srcloc.rs:80:14
135135
|
136136
LL | "invalid_instruction1",
137137
| ^
@@ -143,7 +143,7 @@ LL | invalid_instruction1
143143
| ^
144144

145145
error: unrecognized instruction mnemonic
146-
--> $DIR/srcloc.rs:78:14
146+
--> $DIR/srcloc.rs:81:14
147147
|
148148
LL | "invalid_instruction2",
149149
| ^
@@ -155,7 +155,7 @@ LL | invalid_instruction2
155155
| ^
156156

157157
error: unrecognized instruction mnemonic
158-
--> $DIR/srcloc.rs:84:13
158+
--> $DIR/srcloc.rs:87:13
159159
|
160160
LL | concat!(
161161
| ^
@@ -167,7 +167,7 @@ LL | invalid_instruction1
167167
| ^
168168

169169
error: unrecognized instruction mnemonic
170-
--> $DIR/srcloc.rs:84:13
170+
--> $DIR/srcloc.rs:87:13
171171
|
172172
LL | concat!(
173173
| ^
@@ -179,7 +179,7 @@ LL | invalid_instruction2
179179
| ^
180180

181181
error: unrecognized instruction mnemonic
182-
--> $DIR/srcloc.rs:93:13
182+
--> $DIR/srcloc.rs:96:13
183183
|
184184
LL | concat!(
185185
| ^
@@ -191,7 +191,7 @@ LL | invalid_instruction1
191191
| ^
192192

193193
error: unrecognized instruction mnemonic
194-
--> $DIR/srcloc.rs:93:13
194+
--> $DIR/srcloc.rs:96:13
195195
|
196196
LL | concat!(
197197
| ^
@@ -203,7 +203,7 @@ LL | invalid_instruction2
203203
| ^
204204

205205
error: unrecognized instruction mnemonic
206-
--> $DIR/srcloc.rs:97:13
206+
--> $DIR/srcloc.rs:100:13
207207
|
208208
LL | concat!(
209209
| ^
@@ -215,7 +215,7 @@ LL | invalid_instruction3
215215
| ^
216216

217217
error: unrecognized instruction mnemonic
218-
--> $DIR/srcloc.rs:97:13
218+
--> $DIR/srcloc.rs:100:13
219219
|
220220
LL | concat!(
221221
| ^
@@ -227,7 +227,7 @@ LL | invalid_instruction4
227227
| ^
228228

229229
error: unrecognized instruction mnemonic
230-
--> $DIR/srcloc.rs:108:13
230+
--> $DIR/srcloc.rs:111:13
231231
|
232232
LL | concat!(
233233
| ^
@@ -239,7 +239,7 @@ LL | invalid_instruction1
239239
| ^
240240

241241
error: unrecognized instruction mnemonic
242-
--> $DIR/srcloc.rs:108:13
242+
--> $DIR/srcloc.rs:111:13
243243
|
244244
LL | concat!(
245245
| ^
@@ -251,7 +251,7 @@ LL | invalid_instruction2
251251
| ^
252252

253253
error: unrecognized instruction mnemonic
254-
--> $DIR/srcloc.rs:112:13
254+
--> $DIR/srcloc.rs:115:13
255255
|
256256
LL | concat!(
257257
| ^
@@ -263,7 +263,7 @@ LL | invalid_instruction3
263263
| ^
264264

265265
error: unrecognized instruction mnemonic
266-
--> $DIR/srcloc.rs:112:13
266+
--> $DIR/srcloc.rs:115:13
267267
|
268268
LL | concat!(
269269
| ^
@@ -275,7 +275,7 @@ LL | invalid_instruction4
275275
| ^
276276

277277
error: unrecognized instruction mnemonic
278-
--> $DIR/srcloc.rs:125:14
278+
--> $DIR/srcloc.rs:128:14
279279
|
280280
LL | "invalid_instruction"
281281
| ^

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
//@ revisions: old new
12
//@ only-aarch64
23
//@ build-fail
34
//@ needs-asm-support
45
//@ compile-flags: -Ccodegen-units=1
6+
//@[old] ignore-llvm-version: 19 - 99
7+
//@[new] min-llvm-version: 19
58

69
use std::arch::asm;
710

‎tests/ui/asm/inline-syntax.arm.stderr

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
error: unknown directive
2-
.intel_syntax noprefix
3-
^
4-
error: unknown directive
5-
.intel_syntax noprefix
6-
^
2+
|
3+
note: instantiated into assembly here
4+
--> <inline asm>:1:1
5+
|
6+
LL | .intel_syntax noprefix
7+
| ^
8+
79
error: unknown directive
810
|
911
note: instantiated into assembly here
@@ -13,10 +15,10 @@ LL | .intel_syntax noprefix
1315
| ^
1416

1517
error: unknown directive
16-
--> $DIR/inline-syntax.rs:35:15
18+
--> $DIR/inline-syntax.rs:41:15
1719
|
1820
LL | asm!(".intel_syntax noprefix", "nop");
19-
| ^
21+
| ^^^^^^^^^^^^^^^^^^^^^^
2022
|
2123
note: instantiated into assembly here
2224
--> <inline asm>:1:2
@@ -25,10 +27,10 @@ LL | .intel_syntax noprefix
2527
| ^
2628

2729
error: unknown directive
28-
--> $DIR/inline-syntax.rs:39:15
30+
--> $DIR/inline-syntax.rs:45:15
2931
|
3032
LL | asm!(".intel_syntax aaa noprefix", "nop");
31-
| ^
33+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
3234
|
3335
note: instantiated into assembly here
3436
--> <inline asm>:1:2
@@ -37,10 +39,10 @@ LL | .intel_syntax aaa noprefix
3739
| ^
3840

3941
error: unknown directive
40-
--> $DIR/inline-syntax.rs:43:15
42+
--> $DIR/inline-syntax.rs:49:15
4143
|
4244
LL | asm!(".att_syntax noprefix", "nop");
43-
| ^
45+
| ^^^^^^^^^^^^^^^^^^^^
4446
|
4547
note: instantiated into assembly here
4648
--> <inline asm>:1:2
@@ -49,10 +51,10 @@ LL | .att_syntax noprefix
4951
| ^
5052

5153
error: unknown directive
52-
--> $DIR/inline-syntax.rs:47:15
54+
--> $DIR/inline-syntax.rs:53:15
5355
|
5456
LL | asm!(".att_syntax bbb noprefix", "nop");
55-
| ^
57+
| ^^^^^^^^^^^^^^^^^^^^^^^^
5658
|
5759
note: instantiated into assembly here
5860
--> <inline asm>:1:2
@@ -61,10 +63,10 @@ LL | .att_syntax bbb noprefix
6163
| ^
6264

6365
error: unknown directive
64-
--> $DIR/inline-syntax.rs:51:15
66+
--> $DIR/inline-syntax.rs:57:15
6567
|
6668
LL | asm!(".intel_syntax noprefix; nop");
67-
| ^
69+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
6870
|
6971
note: instantiated into assembly here
7072
--> <inline asm>:1:2
@@ -73,16 +75,16 @@ LL | .intel_syntax noprefix; nop
7375
| ^
7476

7577
error: unknown directive
76-
--> $DIR/inline-syntax.rs:58:13
78+
--> $DIR/inline-syntax.rs:64:13
7779
|
7880
LL | .intel_syntax noprefix
79-
| ^
81+
| ^^^^^^^^^^^^^^^^^^^^^^
8082
|
8183
note: instantiated into assembly here
8284
--> <inline asm>:2:13
8385
|
8486
LL | .intel_syntax noprefix
8587
| ^
8688

87-
error: aborting due to 7 previous errors
89+
error: aborting due to 8 previous errors
8890

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
error: unknown directive
2+
.intel_syntax noprefix
3+
^
4+
error: unknown directive
5+
.intel_syntax noprefix
6+
^
7+
error: unknown directive
8+
|
9+
note: instantiated into assembly here
10+
--> <inline asm>:1:1
11+
|
12+
LL | .intel_syntax noprefix
13+
| ^
14+
15+
error: unknown directive
16+
--> $DIR/inline-syntax.rs:41:15
17+
|
18+
LL | asm!(".intel_syntax noprefix", "nop");
19+
| ^
20+
|
21+
note: instantiated into assembly here
22+
--> <inline asm>:1:2
23+
|
24+
LL | .intel_syntax noprefix
25+
| ^
26+
27+
error: unknown directive
28+
--> $DIR/inline-syntax.rs:45:15
29+
|
30+
LL | asm!(".intel_syntax aaa noprefix", "nop");
31+
| ^
32+
|
33+
note: instantiated into assembly here
34+
--> <inline asm>:1:2
35+
|
36+
LL | .intel_syntax aaa noprefix
37+
| ^
38+
39+
error: unknown directive
40+
--> $DIR/inline-syntax.rs:49:15
41+
|
42+
LL | asm!(".att_syntax noprefix", "nop");
43+
| ^
44+
|
45+
note: instantiated into assembly here
46+
--> <inline asm>:1:2
47+
|
48+
LL | .att_syntax noprefix
49+
| ^
50+
51+
error: unknown directive
52+
--> $DIR/inline-syntax.rs:53:15
53+
|
54+
LL | asm!(".att_syntax bbb noprefix", "nop");
55+
| ^
56+
|
57+
note: instantiated into assembly here
58+
--> <inline asm>:1:2
59+
|
60+
LL | .att_syntax bbb noprefix
61+
| ^
62+
63+
error: unknown directive
64+
--> $DIR/inline-syntax.rs:57:15
65+
|
66+
LL | asm!(".intel_syntax noprefix; nop");
67+
| ^
68+
|
69+
note: instantiated into assembly here
70+
--> <inline asm>:1:2
71+
|
72+
LL | .intel_syntax noprefix; nop
73+
| ^
74+
75+
error: unknown directive
76+
--> $DIR/inline-syntax.rs:64:13
77+
|
78+
LL | .intel_syntax noprefix
79+
| ^
80+
|
81+
note: instantiated into assembly here
82+
--> <inline asm>:2:13
83+
|
84+
LL | .intel_syntax noprefix
85+
| ^
86+
87+
error: aborting due to 7 previous errors
88+

‎tests/ui/asm/inline-syntax.arm_llvm_18.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ LL | .intel_syntax noprefix
1515
| ^
1616

1717
error: unknown directive
18-
--> $DIR/inline-syntax.rs:35:15
18+
--> $DIR/inline-syntax.rs:41:15
1919
|
2020
LL | asm!(".intel_syntax noprefix", "nop");
2121
| ^
@@ -27,7 +27,7 @@ LL | .intel_syntax noprefix
2727
| ^
2828

2929
error: unknown directive
30-
--> $DIR/inline-syntax.rs:39:15
30+
--> $DIR/inline-syntax.rs:45:15
3131
|
3232
LL | asm!(".intel_syntax aaa noprefix", "nop");
3333
| ^
@@ -39,7 +39,7 @@ LL | .intel_syntax aaa noprefix
3939
| ^
4040

4141
error: unknown directive
42-
--> $DIR/inline-syntax.rs:43:15
42+
--> $DIR/inline-syntax.rs:49:15
4343
|
4444
LL | asm!(".att_syntax noprefix", "nop");
4545
| ^
@@ -51,7 +51,7 @@ LL | .att_syntax noprefix
5151
| ^
5252

5353
error: unknown directive
54-
--> $DIR/inline-syntax.rs:47:15
54+
--> $DIR/inline-syntax.rs:53:15
5555
|
5656
LL | asm!(".att_syntax bbb noprefix", "nop");
5757
| ^
@@ -63,7 +63,7 @@ LL | .att_syntax bbb noprefix
6363
| ^
6464

6565
error: unknown directive
66-
--> $DIR/inline-syntax.rs:51:15
66+
--> $DIR/inline-syntax.rs:57:15
6767
|
6868
LL | asm!(".intel_syntax noprefix; nop");
6969
| ^
@@ -75,7 +75,7 @@ LL | .intel_syntax noprefix; nop
7575
| ^
7676

7777
error: unknown directive
78-
--> $DIR/inline-syntax.rs:58:13
78+
--> $DIR/inline-syntax.rs:64:13
7979
|
8080
LL | .intel_syntax noprefix
8181
| ^

‎tests/ui/asm/inline-syntax.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1-
//@ revisions: x86_64 arm arm_llvm_18
1+
//@ revisions: x86_64 arm_llvm_17 arm_llvm_18 arm
22
//@[x86_64] compile-flags: --target x86_64-unknown-linux-gnu
33
//@[x86_64] check-pass
44
//@[x86_64] needs-llvm-components: x86
5-
//@[arm] compile-flags: --target armv7-unknown-linux-gnueabihf
6-
//@[arm] build-fail
7-
//@[arm] needs-llvm-components: arm
8-
//@[arm] ignore-llvm-version: 18 - 99
9-
//Newer LLVM produces extra error notes.
5+
//@[arm_llvm_17] compile-flags: --target armv7-unknown-linux-gnueabihf
6+
//@[arm_llvm_17] build-fail
7+
//@[arm_llvm_17] needs-llvm-components: arm
8+
//@[arm_llvm_17] ignore-llvm-version: 18 - 99
9+
// Newer LLVM produces extra error notes.
1010
//@[arm_llvm_18] compile-flags: --target armv7-unknown-linux-gnueabihf
1111
//@[arm_llvm_18] build-fail
1212
//@[arm_llvm_18] needs-llvm-components: arm
1313
//@[arm_llvm_18] min-llvm-version: 18
14+
//@[arm_llvm_18] ignore-llvm-version: 19 - 99
15+
// LLVM 19+ has full support for 64-bit cookies.
16+
//@[arm] compile-flags: --target armv7-unknown-linux-gnueabihf
17+
//@[arm] build-fail
18+
//@[arm] needs-llvm-components: arm
19+
//@[arm] min-llvm-version: 19
1420
//@ needs-asm-support
1521

1622
#![feature(no_core, lang_items, rustc_attrs)]

‎tests/ui/asm/inline-syntax.x86_64.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
warning: avoid using `.intel_syntax`, Intel syntax is the default
2-
--> $DIR/inline-syntax.rs:67:14
2+
--> $DIR/inline-syntax.rs:73:14
33
|
44
LL | global_asm!(".intel_syntax noprefix", "nop");
55
| ^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `#[warn(bad_asm_style)]` on by default
88

99
warning: avoid using `.intel_syntax`, Intel syntax is the default
10-
--> $DIR/inline-syntax.rs:35:15
10+
--> $DIR/inline-syntax.rs:41:15
1111
|
1212
LL | asm!(".intel_syntax noprefix", "nop");
1313
| ^^^^^^^^^^^^^^^^^^^^^^
1414

1515
warning: avoid using `.intel_syntax`, Intel syntax is the default
16-
--> $DIR/inline-syntax.rs:39:15
16+
--> $DIR/inline-syntax.rs:45:15
1717
|
1818
LL | asm!(".intel_syntax aaa noprefix", "nop");
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
2020

2121
warning: avoid using `.att_syntax`, prefer using `options(att_syntax)` instead
22-
--> $DIR/inline-syntax.rs:43:15
22+
--> $DIR/inline-syntax.rs:49:15
2323
|
2424
LL | asm!(".att_syntax noprefix", "nop");
2525
| ^^^^^^^^^^^^^^^^^^^^
2626

2727
warning: avoid using `.att_syntax`, prefer using `options(att_syntax)` instead
28-
--> $DIR/inline-syntax.rs:47:15
28+
--> $DIR/inline-syntax.rs:53:15
2929
|
3030
LL | asm!(".att_syntax bbb noprefix", "nop");
3131
| ^^^^^^^^^^^^^^^^^^^^^^^^
3232

3333
warning: avoid using `.intel_syntax`, Intel syntax is the default
34-
--> $DIR/inline-syntax.rs:51:15
34+
--> $DIR/inline-syntax.rs:57:15
3535
|
3636
LL | asm!(".intel_syntax noprefix; nop");
3737
| ^^^^^^^^^^^^^^^^^^^^^^
3838

3939
warning: avoid using `.intel_syntax`, Intel syntax is the default
40-
--> $DIR/inline-syntax.rs:58:13
40+
--> $DIR/inline-syntax.rs:64:13
4141
|
4242
LL | .intel_syntax noprefix
4343
| ^^^^^^^^^^^^^^^^^^^^^^

‎tests/ui/asm/x86_64/srcloc.new.stderr

Lines changed: 332 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,332 @@
1+
error: invalid instruction mnemonic 'invalid_instruction'
2+
--> $DIR/srcloc.rs:14:15
3+
|
4+
LL | asm!("invalid_instruction");
5+
| ^^^^^^^^^^^^^^^^^^^
6+
|
7+
note: instantiated into assembly here
8+
--> <inline asm>:2:2
9+
|
10+
LL | invalid_instruction
11+
| ^^^^^^^^^^^^^^^^^^^
12+
13+
error: invalid instruction mnemonic 'invalid_instruction'
14+
--> $DIR/srcloc.rs:18:13
15+
|
16+
LL | invalid_instruction
17+
| ^^^^^^^^^^^^^^^^^^^
18+
|
19+
note: instantiated into assembly here
20+
--> <inline asm>:3:13
21+
|
22+
LL | invalid_instruction
23+
| ^^^^^^^^^^^^^^^^^^^
24+
25+
error: invalid instruction mnemonic 'invalid_instruction'
26+
--> $DIR/srcloc.rs:23:13
27+
|
28+
LL | invalid_instruction
29+
| ^^^^^^^^^^^^^^^^^^^
30+
|
31+
note: instantiated into assembly here
32+
--> <inline asm>:3:13
33+
|
34+
LL | invalid_instruction
35+
| ^^^^^^^^^^^^^^^^^^^
36+
37+
error: invalid instruction mnemonic 'invalid_instruction'
38+
--> $DIR/srcloc.rs:29:13
39+
|
40+
LL | invalid_instruction
41+
| ^^^^^^^^^^^^^^^^^^^
42+
|
43+
note: instantiated into assembly here
44+
--> <inline asm>:4:13
45+
|
46+
LL | invalid_instruction
47+
| ^^^^^^^^^^^^^^^^^^^
48+
49+
error: invalid instruction mnemonic 'invalid_instruction'
50+
--> $DIR/srcloc.rs:36:13
51+
|
52+
LL | invalid_instruction
53+
| ^^^^^^^^^^^^^^^^^^^
54+
|
55+
note: instantiated into assembly here
56+
--> <inline asm>:4:13
57+
|
58+
LL | invalid_instruction
59+
| ^^^^^^^^^^^^^^^^^^^
60+
61+
error: invalid instruction mnemonic 'invalid_instruction'
62+
--> $DIR/srcloc.rs:41:14
63+
|
64+
LL | asm!(concat!("invalid", "_", "instruction"));
65+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66+
|
67+
note: instantiated into assembly here
68+
--> <inline asm>:2:2
69+
|
70+
LL | invalid_instruction
71+
| ^^^^^^^^^^^^^^^^^^^
72+
73+
warning: scale factor without index register is ignored
74+
--> $DIR/srcloc.rs:44:15
75+
|
76+
LL | asm!("movaps %xmm3, (%esi, 2)", options(att_syntax));
77+
| ^^^^^^^^^^^^^^^^^^^^^^^
78+
|
79+
note: instantiated into assembly here
80+
--> <inline asm>:1:23
81+
|
82+
LL | movaps %xmm3, (%esi, 2)
83+
| ^
84+
85+
error: invalid instruction mnemonic 'invalid_instruction'
86+
--> $DIR/srcloc.rs:48:14
87+
|
88+
LL | "invalid_instruction",
89+
| ^^^^^^^^^^^^^^^^^^^
90+
|
91+
note: instantiated into assembly here
92+
--> <inline asm>:2:2
93+
|
94+
LL | invalid_instruction
95+
| ^^^^^^^^^^^^^^^^^^^
96+
97+
error: invalid instruction mnemonic 'invalid_instruction'
98+
--> $DIR/srcloc.rs:54:14
99+
|
100+
LL | "invalid_instruction",
101+
| ^^^^^^^^^^^^^^^^^^^
102+
|
103+
note: instantiated into assembly here
104+
--> <inline asm>:3:1
105+
|
106+
LL | invalid_instruction
107+
| ^^^^^^^^^^^^^^^^^^^
108+
109+
error: invalid instruction mnemonic 'invalid_instruction'
110+
--> $DIR/srcloc.rs:61:14
111+
|
112+
LL | "invalid_instruction",
113+
| ^^^^^^^^^^^^^^^^^^^
114+
|
115+
note: instantiated into assembly here
116+
--> <inline asm>:4:1
117+
|
118+
LL | invalid_instruction
119+
| ^^^^^^^^^^^^^^^^^^^
120+
121+
error: invalid instruction mnemonic 'invalid_instruction'
122+
--> $DIR/srcloc.rs:68:13
123+
|
124+
LL | concat!("invalid", "_", "instruction"),
125+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
126+
|
127+
note: instantiated into assembly here
128+
--> <inline asm>:3:1
129+
|
130+
LL | invalid_instruction
131+
| ^^^^^^^^^^^^^^^^^^^
132+
133+
error: invalid instruction mnemonic 'invalid_instruction'
134+
--> $DIR/srcloc.rs:75:13
135+
|
136+
LL | concat!("invalid", "_", "instruction"),
137+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
138+
|
139+
note: instantiated into assembly here
140+
--> <inline asm>:3:1
141+
|
142+
LL | invalid_instruction
143+
| ^^^^^^^^^^^^^^^^^^^
144+
145+
error: invalid instruction mnemonic 'invalid_instruction1'
146+
--> $DIR/srcloc.rs:82:14
147+
|
148+
LL | "invalid_instruction1",
149+
| ^^^^^^^^^^^^^^^^^^^^
150+
|
151+
note: instantiated into assembly here
152+
--> <inline asm>:2:2
153+
|
154+
LL | invalid_instruction1
155+
| ^^^^^^^^^^^^^^^^^^^^
156+
157+
error: invalid instruction mnemonic 'invalid_instruction2'
158+
--> $DIR/srcloc.rs:83:14
159+
|
160+
LL | "invalid_instruction2",
161+
| ^^^^^^^^^^^^^^^^^^^^
162+
|
163+
note: instantiated into assembly here
164+
--> <inline asm>:3:1
165+
|
166+
LL | invalid_instruction2
167+
| ^^^^^^^^^^^^^^^^^^^^
168+
169+
error: invalid instruction mnemonic 'invalid_instruction1'
170+
--> $DIR/srcloc.rs:89:13
171+
|
172+
LL | / concat!(
173+
LL | | "invalid", "_", "instruction1", "\n",
174+
LL | | "invalid", "_", "instruction2",
175+
LL | | ),
176+
| |_____________^
177+
|
178+
note: instantiated into assembly here
179+
--> <inline asm>:2:2
180+
|
181+
LL | invalid_instruction1
182+
| ^^^^^^^^^^^^^^^^^^^^
183+
184+
error: invalid instruction mnemonic 'invalid_instruction2'
185+
--> $DIR/srcloc.rs:89:13
186+
|
187+
LL | / concat!(
188+
LL | | "invalid", "_", "instruction1", "\n",
189+
LL | | "invalid", "_", "instruction2",
190+
LL | | ),
191+
| |_____________^
192+
|
193+
note: instantiated into assembly here
194+
--> <inline asm>:3:1
195+
|
196+
LL | invalid_instruction2
197+
| ^^^^^^^^^^^^^^^^^^^^
198+
199+
error: invalid instruction mnemonic 'invalid_instruction1'
200+
--> $DIR/srcloc.rs:98:13
201+
|
202+
LL | / concat!(
203+
LL | | "invalid", "_", "instruction1", "\n",
204+
LL | | "invalid", "_", "instruction2",
205+
LL | | ),
206+
| |_____________^
207+
|
208+
note: instantiated into assembly here
209+
--> <inline asm>:2:2
210+
|
211+
LL | invalid_instruction1
212+
| ^^^^^^^^^^^^^^^^^^^^
213+
214+
error: invalid instruction mnemonic 'invalid_instruction2'
215+
--> $DIR/srcloc.rs:98:13
216+
|
217+
LL | / concat!(
218+
LL | | "invalid", "_", "instruction1", "\n",
219+
LL | | "invalid", "_", "instruction2",
220+
LL | | ),
221+
| |_____________^
222+
|
223+
note: instantiated into assembly here
224+
--> <inline asm>:3:1
225+
|
226+
LL | invalid_instruction2
227+
| ^^^^^^^^^^^^^^^^^^^^
228+
229+
error: invalid instruction mnemonic 'invalid_instruction3'
230+
--> $DIR/srcloc.rs:102:13
231+
|
232+
LL | / concat!(
233+
LL | | "invalid", "_", "instruction3", "\n",
234+
LL | | "invalid", "_", "instruction4",
235+
LL | | ),
236+
| |_____________^
237+
|
238+
note: instantiated into assembly here
239+
--> <inline asm>:4:1
240+
|
241+
LL | invalid_instruction3
242+
| ^^^^^^^^^^^^^^^^^^^^
243+
244+
error: invalid instruction mnemonic 'invalid_instruction4'
245+
--> $DIR/srcloc.rs:102:13
246+
|
247+
LL | / concat!(
248+
LL | | "invalid", "_", "instruction3", "\n",
249+
LL | | "invalid", "_", "instruction4",
250+
LL | | ),
251+
| |_____________^
252+
|
253+
note: instantiated into assembly here
254+
--> <inline asm>:5:1
255+
|
256+
LL | invalid_instruction4
257+
| ^^^^^^^^^^^^^^^^^^^^
258+
259+
error: invalid instruction mnemonic 'invalid_instruction1'
260+
--> $DIR/srcloc.rs:113:13
261+
|
262+
LL | / concat!(
263+
LL | | "invalid", "_", "instruction1", "\n",
264+
LL | | "invalid", "_", "instruction2", "\n",
265+
LL | | ),
266+
| |_____________^
267+
|
268+
note: instantiated into assembly here
269+
--> <inline asm>:2:2
270+
|
271+
LL | invalid_instruction1
272+
| ^^^^^^^^^^^^^^^^^^^^
273+
274+
error: invalid instruction mnemonic 'invalid_instruction2'
275+
--> $DIR/srcloc.rs:113:13
276+
|
277+
LL | / concat!(
278+
LL | | "invalid", "_", "instruction1", "\n",
279+
LL | | "invalid", "_", "instruction2", "\n",
280+
LL | | ),
281+
| |_____________^
282+
|
283+
note: instantiated into assembly here
284+
--> <inline asm>:3:1
285+
|
286+
LL | invalid_instruction2
287+
| ^^^^^^^^^^^^^^^^^^^^
288+
289+
error: invalid instruction mnemonic 'invalid_instruction3'
290+
--> $DIR/srcloc.rs:117:13
291+
|
292+
LL | / concat!(
293+
LL | | "invalid", "_", "instruction3", "\n",
294+
LL | | "invalid", "_", "instruction4", "\n",
295+
LL | | ),
296+
| |_____________^
297+
|
298+
note: instantiated into assembly here
299+
--> <inline asm>:5:1
300+
|
301+
LL | invalid_instruction3
302+
| ^^^^^^^^^^^^^^^^^^^^
303+
304+
error: invalid instruction mnemonic 'invalid_instruction4'
305+
--> $DIR/srcloc.rs:117:13
306+
|
307+
LL | / concat!(
308+
LL | | "invalid", "_", "instruction3", "\n",
309+
LL | | "invalid", "_", "instruction4", "\n",
310+
LL | | ),
311+
| |_____________^
312+
|
313+
note: instantiated into assembly here
314+
--> <inline asm>:6:1
315+
|
316+
LL | invalid_instruction4
317+
| ^^^^^^^^^^^^^^^^^^^^
318+
319+
error: invalid instruction mnemonic 'invalid_instruction'
320+
--> $DIR/srcloc.rs:130:14
321+
|
322+
LL | "invalid_instruction"
323+
| ^^^^^^^^^^^^^^^^^^^
324+
|
325+
note: instantiated into assembly here
326+
--> <inline asm>:5:1
327+
|
328+
LL | invalid_instruction
329+
| ^^^^^^^^^^^^^^^^^^^
330+
331+
error: aborting due to 24 previous errors; 1 warning emitted
332+

‎tests/ui/asm/x86_64/srcloc.stderr renamed to ‎tests/ui/asm/x86_64/srcloc.old.stderr

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: invalid instruction mnemonic 'invalid_instruction'
2-
--> $DIR/srcloc.rs:11:15
2+
--> $DIR/srcloc.rs:14:15
33
|
44
LL | asm!("invalid_instruction");
55
| ^
@@ -11,7 +11,7 @@ LL | invalid_instruction
1111
| ^^^^^^^^^^^^^^^^^^^
1212

1313
error: invalid instruction mnemonic 'invalid_instruction'
14-
--> $DIR/srcloc.rs:15:13
14+
--> $DIR/srcloc.rs:18:13
1515
|
1616
LL | invalid_instruction
1717
| ^
@@ -23,7 +23,7 @@ LL | invalid_instruction
2323
| ^^^^^^^^^^^^^^^^^^^
2424

2525
error: invalid instruction mnemonic 'invalid_instruction'
26-
--> $DIR/srcloc.rs:20:13
26+
--> $DIR/srcloc.rs:23:13
2727
|
2828
LL | invalid_instruction
2929
| ^
@@ -35,7 +35,7 @@ LL | invalid_instruction
3535
| ^^^^^^^^^^^^^^^^^^^
3636

3737
error: invalid instruction mnemonic 'invalid_instruction'
38-
--> $DIR/srcloc.rs:26:13
38+
--> $DIR/srcloc.rs:29:13
3939
|
4040
LL | invalid_instruction
4141
| ^
@@ -47,7 +47,7 @@ LL | invalid_instruction
4747
| ^^^^^^^^^^^^^^^^^^^
4848

4949
error: invalid instruction mnemonic 'invalid_instruction'
50-
--> $DIR/srcloc.rs:33:13
50+
--> $DIR/srcloc.rs:36:13
5151
|
5252
LL | invalid_instruction
5353
| ^
@@ -59,7 +59,7 @@ LL | invalid_instruction
5959
| ^^^^^^^^^^^^^^^^^^^
6060

6161
error: invalid instruction mnemonic 'invalid_instruction'
62-
--> $DIR/srcloc.rs:38:14
62+
--> $DIR/srcloc.rs:41:14
6363
|
6464
LL | asm!(concat!("invalid", "_", "instruction"));
6565
| ^
@@ -71,7 +71,7 @@ LL | invalid_instruction
7171
| ^^^^^^^^^^^^^^^^^^^
7272

7373
warning: scale factor without index register is ignored
74-
--> $DIR/srcloc.rs:41:15
74+
--> $DIR/srcloc.rs:44:15
7575
|
7676
LL | asm!("movaps %xmm3, (%esi, 2)", options(att_syntax));
7777
| ^
@@ -83,7 +83,7 @@ LL | movaps %xmm3, (%esi, 2)
8383
| ^
8484

8585
error: invalid instruction mnemonic 'invalid_instruction'
86-
--> $DIR/srcloc.rs:45:14
86+
--> $DIR/srcloc.rs:48:14
8787
|
8888
LL | "invalid_instruction",
8989
| ^
@@ -95,7 +95,7 @@ LL | invalid_instruction
9595
| ^^^^^^^^^^^^^^^^^^^
9696

9797
error: invalid instruction mnemonic 'invalid_instruction'
98-
--> $DIR/srcloc.rs:51:14
98+
--> $DIR/srcloc.rs:54:14
9999
|
100100
LL | "invalid_instruction",
101101
| ^
@@ -107,7 +107,7 @@ LL | invalid_instruction
107107
| ^^^^^^^^^^^^^^^^^^^
108108

109109
error: invalid instruction mnemonic 'invalid_instruction'
110-
--> $DIR/srcloc.rs:58:14
110+
--> $DIR/srcloc.rs:61:14
111111
|
112112
LL | "invalid_instruction",
113113
| ^
@@ -119,7 +119,7 @@ LL | invalid_instruction
119119
| ^^^^^^^^^^^^^^^^^^^
120120

121121
error: invalid instruction mnemonic 'invalid_instruction'
122-
--> $DIR/srcloc.rs:65:13
122+
--> $DIR/srcloc.rs:68:13
123123
|
124124
LL | concat!("invalid", "_", "instruction"),
125125
| ^
@@ -131,7 +131,7 @@ LL | invalid_instruction
131131
| ^^^^^^^^^^^^^^^^^^^
132132

133133
error: invalid instruction mnemonic 'invalid_instruction'
134-
--> $DIR/srcloc.rs:72:13
134+
--> $DIR/srcloc.rs:75:13
135135
|
136136
LL | concat!("invalid", "_", "instruction"),
137137
| ^
@@ -143,7 +143,7 @@ LL | invalid_instruction
143143
| ^^^^^^^^^^^^^^^^^^^
144144

145145
error: invalid instruction mnemonic 'invalid_instruction1'
146-
--> $DIR/srcloc.rs:79:14
146+
--> $DIR/srcloc.rs:82:14
147147
|
148148
LL | "invalid_instruction1",
149149
| ^
@@ -155,7 +155,7 @@ LL | invalid_instruction1
155155
| ^^^^^^^^^^^^^^^^^^^^
156156

157157
error: invalid instruction mnemonic 'invalid_instruction2'
158-
--> $DIR/srcloc.rs:80:14
158+
--> $DIR/srcloc.rs:83:14
159159
|
160160
LL | "invalid_instruction2",
161161
| ^
@@ -167,7 +167,7 @@ LL | invalid_instruction2
167167
| ^^^^^^^^^^^^^^^^^^^^
168168

169169
error: invalid instruction mnemonic 'invalid_instruction1'
170-
--> $DIR/srcloc.rs:86:13
170+
--> $DIR/srcloc.rs:89:13
171171
|
172172
LL | concat!(
173173
| ^
@@ -179,7 +179,7 @@ LL | invalid_instruction1
179179
| ^^^^^^^^^^^^^^^^^^^^
180180

181181
error: invalid instruction mnemonic 'invalid_instruction2'
182-
--> $DIR/srcloc.rs:86:13
182+
--> $DIR/srcloc.rs:89:13
183183
|
184184
LL | concat!(
185185
| ^
@@ -191,7 +191,7 @@ LL | invalid_instruction2
191191
| ^^^^^^^^^^^^^^^^^^^^
192192

193193
error: invalid instruction mnemonic 'invalid_instruction1'
194-
--> $DIR/srcloc.rs:95:13
194+
--> $DIR/srcloc.rs:98:13
195195
|
196196
LL | concat!(
197197
| ^
@@ -203,7 +203,7 @@ LL | invalid_instruction1
203203
| ^^^^^^^^^^^^^^^^^^^^
204204

205205
error: invalid instruction mnemonic 'invalid_instruction2'
206-
--> $DIR/srcloc.rs:95:13
206+
--> $DIR/srcloc.rs:98:13
207207
|
208208
LL | concat!(
209209
| ^
@@ -215,7 +215,7 @@ LL | invalid_instruction2
215215
| ^^^^^^^^^^^^^^^^^^^^
216216

217217
error: invalid instruction mnemonic 'invalid_instruction3'
218-
--> $DIR/srcloc.rs:99:13
218+
--> $DIR/srcloc.rs:102:13
219219
|
220220
LL | concat!(
221221
| ^
@@ -227,7 +227,7 @@ LL | invalid_instruction3
227227
| ^^^^^^^^^^^^^^^^^^^^
228228

229229
error: invalid instruction mnemonic 'invalid_instruction4'
230-
--> $DIR/srcloc.rs:99:13
230+
--> $DIR/srcloc.rs:102:13
231231
|
232232
LL | concat!(
233233
| ^
@@ -239,7 +239,7 @@ LL | invalid_instruction4
239239
| ^^^^^^^^^^^^^^^^^^^^
240240

241241
error: invalid instruction mnemonic 'invalid_instruction1'
242-
--> $DIR/srcloc.rs:110:13
242+
--> $DIR/srcloc.rs:113:13
243243
|
244244
LL | concat!(
245245
| ^
@@ -251,7 +251,7 @@ LL | invalid_instruction1
251251
| ^^^^^^^^^^^^^^^^^^^^
252252

253253
error: invalid instruction mnemonic 'invalid_instruction2'
254-
--> $DIR/srcloc.rs:110:13
254+
--> $DIR/srcloc.rs:113:13
255255
|
256256
LL | concat!(
257257
| ^
@@ -263,7 +263,7 @@ LL | invalid_instruction2
263263
| ^^^^^^^^^^^^^^^^^^^^
264264

265265
error: invalid instruction mnemonic 'invalid_instruction3'
266-
--> $DIR/srcloc.rs:114:13
266+
--> $DIR/srcloc.rs:117:13
267267
|
268268
LL | concat!(
269269
| ^
@@ -275,7 +275,7 @@ LL | invalid_instruction3
275275
| ^^^^^^^^^^^^^^^^^^^^
276276

277277
error: invalid instruction mnemonic 'invalid_instruction4'
278-
--> $DIR/srcloc.rs:114:13
278+
--> $DIR/srcloc.rs:117:13
279279
|
280280
LL | concat!(
281281
| ^
@@ -287,7 +287,7 @@ LL | invalid_instruction4
287287
| ^^^^^^^^^^^^^^^^^^^^
288288

289289
error: invalid instruction mnemonic 'invalid_instruction'
290-
--> $DIR/srcloc.rs:127:14
290+
--> $DIR/srcloc.rs:130:14
291291
|
292292
LL | "invalid_instruction"
293293
| ^

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
//@ revisions: old new
12
//@ only-x86_64
23
//@ build-fail
34
//@ compile-flags: -Ccodegen-units=1
5+
//@[old] ignore-llvm-version: 19 - 99
6+
//@[new] min-llvm-version: 19
47

58
use std::arch::asm;
69

0 commit comments

Comments
 (0)
Please sign in to comment.