1; RUN: llc -mtriple=arm64--- -stop-after=finalize-isel -o - %s | FileCheck %s
2
3; Check that we ignore the zeroext attribute on the return type of the tail
4; call, since the return value is unused. This happens during CodeGenPrepare in
5; dupRetToEnableTailCallOpts, which calls attributesPermitTailCall to check if
6; the attributes of the caller and the callee match.
7
8declare zeroext i1 @zcallee()
9define void @zcaller() {
10; CHECK-LABEL: name: zcaller
11entry:
12  br i1 undef, label %calllabel, label %retlabel
13calllabel:
14; CHECK: bb.1.calllabel:
15; CHECK-NOT: BL @zcallee
16; CHECK-NEXT: TCRETURNdi @zcallee
17  %unused_result = tail call zeroext i1 @zcallee()
18  br label %retlabel
19retlabel:
20  ret void
21}
22
23declare signext i1 @scallee()
24define void @scaller() {
25; CHECK-LABEL: name: scaller
26entry:
27  br i1 undef, label %calllabel, label %retlabel
28calllabel:
29; CHECK: bb.1.calllabel:
30; CHECK-NOT: BL @scallee
31; CHECK-NEXT: TCRETURNdi @scallee
32  %unused_result = tail call signext i1 @scallee()
33  br label %retlabel
34retlabel:
35  ret void
36}
37