about summary refs log tree commit diff
path: root/tests/ui/asm/global-asm-mono-sym-fn.rs
blob: e584a98badb0d73903e05b62d3ceff6aa3435f88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Test that we're properly monomorphizing sym args in global asm blocks
// that point to associated items.

//@ edition: 2021
//@ needs-asm-support
//@ only-x86_64-unknown-linux-gnu
//@ build-pass

#![no_main]

use std::arch::global_asm;

fn foo() {
    loop {}
}

trait Foo {
    fn bar();
}

impl Foo for i32 {
    fn bar() {
        loop {}
    }
}

global_asm!(".global main", "main:", "call {}", sym <i32 as Foo>::bar);