1
1
//@ assembly-output: emit-asm
2
2
//@ compile-flags: --target hexagon-unknown-linux-musl
3
+ //@ compile-flags: -Zmerge-functions=disabled
3
4
//@ needs-llvm-components: hexagon
4
5
5
6
#![ feature( no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch) ]
@@ -41,12 +42,6 @@ macro_rules! check {
41
42
( $func: ident $ty: ident $class: ident) => {
42
43
#[ no_mangle]
43
44
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
-
50
45
let y;
51
46
asm!( "{} = {}" , out( $class) y, in( $class) x) ;
52
47
y
@@ -58,12 +53,6 @@ macro_rules! check_reg {
58
53
( $func: ident $ty: ident $reg: tt) => {
59
54
#[ no_mangle]
60
55
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
-
67
56
let y;
68
57
asm!( concat!( $reg, " = " , $reg) , lateout( $reg) y, in( $reg) x) ;
69
58
y
@@ -77,12 +66,6 @@ macro_rules! check_reg {
77
66
// CHECK: InlineAsm End
78
67
#[ no_mangle]
79
68
pub 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
-
86
69
asm ! ( "r0 = #{}" , sym extern_static) ;
87
70
}
88
71
@@ -92,12 +75,6 @@ pub unsafe fn sym_static() {
92
75
// CHECK: InlineAsm End
93
76
#[ no_mangle]
94
77
pub 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
-
101
78
asm ! ( "r0 = #{}" , sym extern_func) ;
102
79
}
103
80
0 commit comments