xref: /aosp_15_r20/external/llvm/test/Feature/callingconventions.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llvm-as < %s | llvm-dis > %t1.ll
2*9880d681SAndroid Build Coastguard Worker; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
3*9880d681SAndroid Build Coastguard Worker; RUN: diff %t1.ll %t2.ll
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Workerdefine fastcc void @foo() {
6*9880d681SAndroid Build Coastguard Worker        ret void
7*9880d681SAndroid Build Coastguard Worker}
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Workerdefine coldcc void @bar() {
10*9880d681SAndroid Build Coastguard Worker        call fastcc void @foo( )
11*9880d681SAndroid Build Coastguard Worker        ret void
12*9880d681SAndroid Build Coastguard Worker}
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Workerdefine void @structret({ i8 }* sret  %P) {
15*9880d681SAndroid Build Coastguard Worker        call void @structret( { i8 }* sret  %P )
16*9880d681SAndroid Build Coastguard Worker        ret void
17*9880d681SAndroid Build Coastguard Worker}
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard Workerdefine void @foo2() {
20*9880d681SAndroid Build Coastguard Worker        ret void
21*9880d681SAndroid Build Coastguard Worker}
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Workerdefine coldcc void @bar2() {
24*9880d681SAndroid Build Coastguard Worker        call fastcc void @foo( )
25*9880d681SAndroid Build Coastguard Worker        ret void
26*9880d681SAndroid Build Coastguard Worker}
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard Workerdefine cc42 void @bar3() personality i32 (...)* @__gxx_personality_v0 {
29*9880d681SAndroid Build Coastguard Worker  invoke fastcc void @foo( )
30*9880d681SAndroid Build Coastguard Worker    to label %Ok unwind label %U
31*9880d681SAndroid Build Coastguard Worker
32*9880d681SAndroid Build Coastguard WorkerOk:
33*9880d681SAndroid Build Coastguard Worker  ret void
34*9880d681SAndroid Build Coastguard Worker
35*9880d681SAndroid Build Coastguard WorkerU:
36*9880d681SAndroid Build Coastguard Worker  %exn = landingpad {i8*, i32}
37*9880d681SAndroid Build Coastguard Worker            cleanup
38*9880d681SAndroid Build Coastguard Worker  resume { i8*, i32 } %exn
39*9880d681SAndroid Build Coastguard Worker}
40*9880d681SAndroid Build Coastguard Worker
41*9880d681SAndroid Build Coastguard Workerdefine void @bar4() personality i32 (...)* @__gxx_personality_v0 {
42*9880d681SAndroid Build Coastguard Worker  call cc42 void @bar( )
43*9880d681SAndroid Build Coastguard Worker  invoke cc42 void @bar3( )
44*9880d681SAndroid Build Coastguard Worker    to label %Ok unwind label %U
45*9880d681SAndroid Build Coastguard Worker
46*9880d681SAndroid Build Coastguard WorkerOk:
47*9880d681SAndroid Build Coastguard Worker  ret void
48*9880d681SAndroid Build Coastguard Worker
49*9880d681SAndroid Build Coastguard WorkerU:
50*9880d681SAndroid Build Coastguard Worker  %exn = landingpad {i8*, i32}
51*9880d681SAndroid Build Coastguard Worker            cleanup
52*9880d681SAndroid Build Coastguard Worker  resume { i8*, i32 } %exn
53*9880d681SAndroid Build Coastguard Worker}
54*9880d681SAndroid Build Coastguard Worker
55*9880d681SAndroid Build Coastguard Workerdeclare ghccc void @ghc_callee()
56*9880d681SAndroid Build Coastguard Worker
57*9880d681SAndroid Build Coastguard Workerdefine void @ghc_caller() {
58*9880d681SAndroid Build Coastguard Worker  call ghccc void @ghc_callee()
59*9880d681SAndroid Build Coastguard Worker  ret void
60*9880d681SAndroid Build Coastguard Worker}
61*9880d681SAndroid Build Coastguard Worker
62*9880d681SAndroid Build Coastguard Workerdeclare hhvm_ccc void @hhvm_c_callee()
63*9880d681SAndroid Build Coastguard Worker
64*9880d681SAndroid Build Coastguard Workerdefine hhvmcc void @hhvm_caller() {
65*9880d681SAndroid Build Coastguard Worker  call hhvm_ccc void @hhvm_c_callee()
66*9880d681SAndroid Build Coastguard Worker  ret void
67*9880d681SAndroid Build Coastguard Worker}
68*9880d681SAndroid Build Coastguard Worker
69*9880d681SAndroid Build Coastguard Workerdeclare i32 @__gxx_personality_v0(...)
70