1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc < %s -mtriple=avr -mattr=-eijmpcall | FileCheck %s --check-prefix=ICALL 3; RUN: llc < %s -mtriple=avr -mattr=+eijmpcall | FileCheck %s --check-prefix=EICALL 4 5; This test verifies the bug https://github.com/llvm/llvm-project/issues/58856 6 7declare dso_local i16 @func() 8 9define i16 @foo() { 10; ICALL-LABEL: foo: 11; ICALL: ; %bb.0: 12; ICALL-NEXT: ldi r30, pm_lo8(func) 13; ICALL-NEXT: ldi r31, pm_hi8(func) 14; ICALL-NEXT: ;APP 15; ICALL-NEXT: ;NO_APP 16; ICALL-NEXT: icall 17; ICALL-NEXT: ret 18; 19; EICALL-LABEL: foo: 20; EICALL: ; %bb.0: 21; EICALL-NEXT: ldi r30, lo8_gs(func) 22; EICALL-NEXT: ldi r31, hi8_gs(func) 23; EICALL-NEXT: ;APP 24; EICALL-NEXT: ;NO_APP 25; EICALL-NEXT: eicall 26; EICALL-NEXT: ret 27 %1 = tail call addrspace(0) ptr addrspace(1) asm "", "=r,0"(ptr addrspace(1) @func) 28 %2 = tail call i16 %1() 29 ret i16 %2 30} 31