]> git.proxmox.com Git - rustc.git/blame - src/test/codegen/asm-sanitize-llvm.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / test / codegen / asm-sanitize-llvm.rs
CommitLineData
6a06907d
XL
1// FIXME(nagisa): remove the flags here once all targets support `asm!`.
2// compile-flags: --target x86_64-unknown-linux-gnu
3
4// Verify we sanitize the special tokens for the LLVM inline-assembly, ensuring people won't
5// inadvertently rely on the LLVM-specific syntax and features.
6#![no_core]
7#![feature(no_core, lang_items, rustc_attrs)]
8#![crate_type = "rlib"]
9
10#[rustc_builtin_macro]
11macro_rules! asm {
12 () => {};
13}
14
15#[lang = "sized"]
16trait Sized {}
17#[lang = "copy"]
18trait Copy {}
19
20pub unsafe fn we_escape_dollar_signs() {
21 // CHECK: call void asm sideeffect alignstack inteldialect "banana$$:"
22 asm!(
23 r"banana$:",
24 )
25}
26
27pub unsafe fn we_escape_escapes_too() {
28 // CHECK: call void asm sideeffect alignstack inteldialect "banana\{{(\\|5C)}}36:"
29 asm!(
30 r"banana\36:",
31 )
32}