2 ; RUN: llc -mtriple=mips-linux-gnu -emit-call-site-info %s -stop-before=finalize-isel -o -| \
3 ; RUN: llc -mtriple=mips-linux-gnu -emit-call-site-info -x='mir' -run-pass=finalize-isel -o -| FileCheck %s
5 ; RUN: llc -mtriple=mips64-linux-gnu -emit-call-site-info %s -stop-before=finalize-isel -o -| \
6 ; RUN: llc -mtriple=mips64-linux-gnu -emit-call-site-info -x='mir' -run-pass=finalize-isel -o -| FileCheck %s --check-prefix=CHECK64
8 ; RUN: llc -mtriple=mipsel-linux-gnu -emit-call-site-info %s -stop-before=finalize-isel -o -| \
9 ; RUN: llc -mtriple=mipsel-linux-gnu -emit-call-site-info -x='mir' -run-pass=finalize-isel -o -| FileCheck %s
11 ; RUN: llc -mtriple=mips64el-linux-gnu -emit-call-site-info %s -stop-before=finalize-isel -o -| \
12 ; RUN: llc -mtriple=mips64el-linux-gnu -emit-call-site-info -x='mir' -run-pass=finalize-isel -o -| FileCheck %s --check-prefix=CHECK64
14 ;; Test call site info MIR parser and printer. Parser assertions and machine
15 ;; verifier will check the rest.
16 ;; There is no need to verify call instruction location since it will be
17 ;; checked by the MIR parser.
18 ;; Verify that we are able to parse output mir and that we are getting valid call site info.
21 ;; extern int fn1(int,int,int);
22 ;; int fn2(int a, int b, int c) {
23 ;; int local = fn1(a+b, c, 10);
29 ;; Test mips32 and mips32el:
32 ; CHECK-NEXT: bb: {{.*}}, offset: {{.*}}, fwdArgRegs:
33 ; CHECK-NEXT: arg: 0, reg: '$a0'
34 ; CHECK-NEXT: arg: 1, reg: '$a1'
35 ; CHECK-NEXT: arg: 2, reg: '$a2'
37 ;; Test mips64 and mips64el:
40 ; CHECK64-NEXT: bb: {{.*}}, offset: {{.*}}, fwdArgRegs:
41 ; CHECK64-NEXT: arg: 0, reg: '$a0_64'
42 ; CHECK64-NEXT: arg: 1, reg: '$a1_64'
43 ; CHECK64-NEXT: arg: 2, reg: '$a2_64'
45 ; ModuleID = 'test/CodeGen/Mips/call-site-info-output.c'
46 source_filename = "test/CodeGen/Mips/call-site-info-output.c"
47 target datalayout = "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64"
48 target triple = "mips-unknown-linux-gnu"
49 ; Function Attrs: nounwind
50 define dso_local i32 @fn2(i32 signext %a, i32 signext %b, i32 signext %c) local_unnamed_addr {
52 %add = add nsw i32 %b, %a
53 %call = tail call i32 @fn1(i32 signext %add, i32 signext %c, i32 signext 10)
54 %cmp = icmp sgt i32 %call, 10
55 %add1 = add nsw i32 %call, 10
56 %retval.0 = select i1 %cmp, i32 %add1, i32 %call
59 declare dso_local i32 @fn1(i32 signext, i32 signext, i32 signext) local_unnamed_addr
61 !llvm.module.flags = !{!0}
64 !0 = !{i32 1, !"wchar_size", i32 4}
65 !1 = !{!"clang version 11.0.0"}