1; RUN: not opt -verify %s 2>&1 | FileCheck %s
2
3declare tailcc void @simple()
4
5define tailcc void @inreg(i8* inreg) {
6; CHECK: inreg attribute not allowed in tailcc musttail caller
7  musttail call tailcc void @simple()
8  ret void
9}
10
11define tailcc void @inalloca(i8* inalloca(i8)) {
12; CHECK: inalloca attribute not allowed in tailcc musttail caller
13  musttail call tailcc void @simple()
14  ret void
15}
16
17define tailcc void @swifterror(i8** swifterror) {
18; CHECK: swifterror attribute not allowed in tailcc musttail caller
19  musttail call tailcc void @simple()
20  ret void
21}
22
23define tailcc void @preallocated(i8* preallocated(i8)) {
24; CHECK: preallocated attribute not allowed in tailcc musttail caller
25  musttail call tailcc void @simple()
26  ret void
27}
28
29define tailcc void @byref(i8* byref(i8)) {
30; CHECK: byref attribute not allowed in tailcc musttail caller
31  musttail call tailcc void @simple()
32  ret void
33}
34
35define tailcc void @call_inreg() {
36; CHECK: inreg attribute not allowed in tailcc musttail callee
37  musttail call tailcc void @inreg(i8* inreg undef)
38  ret void
39}
40
41define tailcc void @call_inalloca() {
42; CHECK: inalloca attribute not allowed in tailcc musttail callee
43  musttail call tailcc void @inalloca(i8* inalloca(i8) undef)
44  ret void
45}
46
47define tailcc void @call_swifterror() {
48; CHECK: swifterror attribute not allowed in tailcc musttail callee
49  %err = alloca swifterror i8*
50  musttail call tailcc void @swifterror(i8** swifterror %err)
51  ret void
52}
53
54define tailcc void @call_preallocated() {
55; CHECK: preallocated attribute not allowed in tailcc musttail callee
56  musttail call tailcc void @preallocated(i8* preallocated(i8) undef)
57  ret void
58}
59
60define tailcc void @call_byref() {
61; CHECK: byref attribute not allowed in tailcc musttail callee
62  musttail call tailcc void @byref(i8* byref(i8) undef)
63  ret void
64}
65
66
67declare tailcc void @varargs(...)
68define tailcc void @call_varargs(...) {
69; CHECK: cannot guarantee tailcc tail call for varargs function
70  musttail call tailcc void(...) @varargs(...)
71  ret void
72}
73