Skip to content

Commit 8a3bc3f

Browse files
committed
Add test if asm const are MIR inlined and monomorphized twice
1 parent b662cac commit 8a3bc3f

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//@ build-pass
2+
//@ needs-asm-support
3+
4+
#![feature(asm_const_ptr)]
5+
6+
// Force inline to exercise the codegen when the same asm const ptr is code-generated multiple
7+
// times.
8+
#[inline(always)]
9+
fn foo<const N:usize>() {
10+
unsafe{core::arch::asm!("/* {} */", const &N)};
11+
}
12+
13+
fn main(){
14+
foo::<0>();
15+
foo::<0>();
16+
foo::<1>();
17+
}

0 commit comments

Comments
 (0)