xref: /llvm-project/llvm/test/MC/ELF/ifunc-alias.s (revision 980d28d9556a671081719f82aea3de5db4328688)
1b36a3e61SElvina Yakubova// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readelf -s - | FileCheck %s
272e99e63SFangrui Song.text
372e99e63SFangrui Song
472e99e63SFangrui Song.type  foo_impl,@function
572e99e63SFangrui Songfoo_impl:
672e99e63SFangrui Song  ret
772e99e63SFangrui Song
872e99e63SFangrui Song.type  foo_resolver,@function
972e99e63SFangrui Songfoo_resolver:
1072e99e63SFangrui Song  mov $foo_impl, %rax
1172e99e63SFangrui Song  ret
1272e99e63SFangrui Song
1372e99e63SFangrui Song.type  foo,@gnu_indirect_function
1472e99e63SFangrui Song.set   foo,foo_resolver
1572e99e63SFangrui Song
1672e99e63SFangrui Song// All things below should be IFunc identical to 'foo'
1772e99e63SFangrui Song.set   foo2,foo
1872e99e63SFangrui Song.set   foo3,foo2
1972e99e63SFangrui Song.type  foo4,@function
2072e99e63SFangrui Song.set   foo4,foo3
2172e99e63SFangrui Song
2272e99e63SFangrui Song// But tls_object should not be IFunc
2372e99e63SFangrui Song.set   tls,foo
2472e99e63SFangrui Song.type  tls,@tls_object
2572e99e63SFangrui Song
2672e99e63SFangrui Song// CHECK:      FUNC    LOCAL  DEFAULT    2 foo_impl
27*980d28d9SFangrui Song// CHECK-NEXT: FUNC    LOCAL  DEFAULT    2 foo_resolver
28*980d28d9SFangrui Song// CHECK-NEXT: IFUNC   LOCAL  DEFAULT    2 foo
29*980d28d9SFangrui Song// CHECK-NEXT: IFUNC   LOCAL  DEFAULT    2 foo2
30*980d28d9SFangrui Song// CHECK-NEXT: IFUNC   LOCAL  DEFAULT    2 foo3
31*980d28d9SFangrui Song// CHECK-NEXT: IFUNC   LOCAL  DEFAULT    2 foo4
32*980d28d9SFangrui Song// CHECK-NEXT: TLS     LOCAL  DEFAULT    2 tls
33