1 ; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
2 ; RUN: not llvm-as %s -opaque-pointers -o /dev/null 2>&1 | FileCheck %s
4 ; Each musttail call should fail to validate.
6 declare x86_stdcallcc void @cc_mismatch_callee()
7 define void @cc_mismatch() {
8 ; CHECK: mismatched calling conv
9 musttail call x86_stdcallcc void @cc_mismatch_callee()
13 declare void @more_parms_callee(i32)
14 define void @more_parms() {
15 ; CHECK: mismatched parameter counts
16 musttail call void @more_parms_callee(i32 0)
20 declare void @mismatched_intty_callee(i8)
21 define void @mismatched_intty(i32) {
22 ; CHECK: mismatched parameter types
23 musttail call void @mismatched_intty_callee(i8 0)
27 declare void @mismatched_vararg_callee(i8*, ...)
28 define void @mismatched_vararg(i8*) {
29 ; CHECK: mismatched varargs
30 musttail call void (i8*, ...) @mismatched_vararg_callee(i8* null)
34 ; We would make this an implicit sret parameter, which would disturb the
36 declare { i32, i32, i32 } @mismatched_retty_callee(i32)
37 define void @mismatched_retty(i32) {
38 ; CHECK: mismatched return types
39 musttail call { i32, i32, i32 } @mismatched_retty_callee(i32 0)
43 declare void @mismatched_byval_callee({ i32 }*)
44 define void @mismatched_byval({ i32 }* byval({ i32 }) %a) {
45 ; CHECK: mismatched ABI impacting function attributes
46 musttail call void @mismatched_byval_callee({ i32 }* %a)
50 declare void @mismatched_inreg_callee(i32 inreg)
51 define void @mismatched_inreg(i32 %a) {
52 ; CHECK: mismatched ABI impacting function attributes
53 musttail call void @mismatched_inreg_callee(i32 inreg %a)
57 declare void @mismatched_sret_callee(i32* sret(i32))
58 define void @mismatched_sret(i32* %a) {
59 ; CHECK: mismatched ABI impacting function attributes
60 musttail call void @mismatched_sret_callee(i32* sret(i32) %a)
64 declare void @mismatched_alignment_callee(i32* byval(i32) align 8)
65 define void @mismatched_alignment(i32* byval(i32) align 4 %a) {
66 ; CHECK: mismatched ABI impacting function attributes
67 musttail call void @mismatched_alignment_callee(i32* byval(i32) align 8 %a)
71 declare i32 @not_tail_pos_callee()
72 define i32 @not_tail_pos() {
73 ; CHECK: musttail call must precede a ret with an optional bitcast
74 %v = musttail call i32 @not_tail_pos_callee()
79 define void @inline_asm() {
80 ; CHECK: cannot use musttail call with inline asm
81 musttail call void asm "ret", ""()