xref: /llvm-project/llvm/test/CodeGen/X86/call-site-info-output.ll (revision 9b0e1c2ca25be58ea29b318d3515e6171f25f0ea)
1; Test call site info MIR printer and parser.Parser assertions and machine
2; verifier will check the rest;
3; RUN: llc -emit-call-site-info %s -stop-before=finalize-isel -o %t.mir
4; RUN: cat %t.mir | FileCheck %s
5; CHECK: name: fn2
6; CHECK: callSites:
7; There is no need to verify call instruction location since it will be
8; checked by the MIR parser in the next RUN.
9; CHECK-NEXT: bb: {{.*}}, offset: {{.*}}, fwdArgRegs:
10; CHECK-NEXT:   arg: 0, reg: '$edi'
11; CHECK-NEXT:   arg: 1, reg: '$esi'
12; CHECK-NEXT:   arg: 2, reg: '$edx'
13; RUN: llc -emit-call-site-info %t.mir -run-pass=finalize-isel -o -| FileCheck %s --check-prefix=PARSER
14; RUN: llc -emit-call-site-info %t.mir -passes=finalize-isel -o -| FileCheck %s --check-prefix=PARSER
15; Verify that we are able to parse output mir and that we are getting the same result.
16; PARSER: name: fn2
17; PARSER: callSites:
18; PARSER-NEXT: bb: {{.*}}, offset: {{.*}}, fwdArgRegs:
19; PARSER-NEXT:   arg: 0, reg: '$edi'
20; PARSER-NEXT:   arg: 1, reg: '$esi'
21; PARSER-NEXT:   arg: 2, reg: '$edx'
22
23; ModuleID = 'test/CodeGen/X86/call-site-info-output.c'
24source_filename = "test/CodeGen/X86/call-site-info-output.c"
25target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
26target triple = "x86_64-unknown-linux-gnu"
27
28; Function Attrs: noinline nounwind uwtable
29define dso_local i64 @fn2(i32 %a, i32 %b, i32 %c) local_unnamed_addr {
30entry:
31  %call = tail call i32 (i32, i32, i32, ...) @fn1(i32 -50, i32 50, i32 -7)
32  %add = mul i32 %a, 3
33  %sub = sub i32 %add, %b
34  %add2 = add i32 %sub, %c
35  %conv4 = sext i32 %add2 to i64
36  ret i64 %conv4
37}
38
39declare dso_local i32 @fn1(...) local_unnamed_addr
40
41!llvm.module.flags = !{!0}
42!llvm.ident = !{!1}
43
44!0 = !{i32 1, !"wchar_size", i32 4}
45!1 = !{!"clang version 9.0.0"}
46