11//@ assembly-output: emit-asm
22//@ compile-flags: --target hexagon-unknown-linux-musl
3+ //@ compile-flags: -Zmerge-functions=disabled
34//@ needs-llvm-components: hexagon
45
56#![ feature( no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch) ]
@@ -41,12 +42,6 @@ macro_rules! check {
4142 ( $func: ident $ty: ident $class: ident) => {
4243 #[ no_mangle]
4344 pub unsafe fn $func( x: $ty) -> $ty {
44- // Hack to avoid function merging
45- extern "Rust" {
46- fn dont_merge( s: & str ) ;
47- }
48- dont_merge( stringify!( $func) ) ;
49-
5045 let y;
5146 asm!( "{} = {}" , out( $class) y, in( $class) x) ;
5247 y
@@ -58,12 +53,6 @@ macro_rules! check_reg {
5853 ( $func: ident $ty: ident $reg: tt) => {
5954 #[ no_mangle]
6055 pub unsafe fn $func( x: $ty) -> $ty {
61- // Hack to avoid function merging
62- extern "Rust" {
63- fn dont_merge( s: & str ) ;
64- }
65- dont_merge( stringify!( $func) ) ;
66-
6756 let y;
6857 asm!( concat!( $reg, " = " , $reg) , lateout( $reg) y, in( $reg) x) ;
6958 y
@@ -77,12 +66,6 @@ macro_rules! check_reg {
7766// CHECK: InlineAsm End
7867#[ no_mangle]
7968pub unsafe fn sym_static ( ) {
80- // Hack to avoid function merging
81- extern "Rust" {
82- fn dont_merge ( s : & str ) ;
83- }
84- dont_merge ( stringify ! ( $func) ) ;
85-
8669 asm ! ( "r0 = #{}" , sym extern_static) ;
8770}
8871
@@ -92,12 +75,6 @@ pub unsafe fn sym_static() {
9275// CHECK: InlineAsm End
9376#[ no_mangle]
9477pub unsafe fn sym_fn ( ) {
95- // Hack to avoid function merging
96- extern "Rust" {
97- fn dont_merge ( s : & str ) ;
98- }
99- dont_merge ( stringify ! ( $func) ) ;
100-
10178 asm ! ( "r0 = #{}" , sym extern_func) ;
10279}
10380
0 commit comments