Francis Visoiu Mistrih | ac6454a | 2019-01-09 19:46:15 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=arm64--- -stop-after=expand-isel-pseudos -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 | |
| 8 | declare zeroext i1 @zcallee() |
| 9 | define void @zcaller() { |
| 10 | ; CHECK-LABEL: name: zcaller |
| 11 | entry: |
| 12 | br i1 undef, label %calllabel, label %retlabel |
| 13 | calllabel: |
| 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 |
| 19 | retlabel: |
| 20 | ret void |
| 21 | } |
| 22 | |
| 23 | declare signext i1 @scallee() |
| 24 | define void @scaller() { |
| 25 | ; CHECK-LABEL: name: scaller |
| 26 | entry: |
| 27 | br i1 undef, label %calllabel, label %retlabel |
| 28 | calllabel: |
| 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 |
| 34 | retlabel: |
| 35 | ret void |
| 36 | } |