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; Verify that we are able to parse output mir and that we are getting the same result.
15; PARSER: name: fn2
16; PARSER: callSites:
17; PARSER-NEXT: bb: {{.*}}, offset: {{.*}}, fwdArgRegs:
18; PARSER-NEXT:   arg: 0, reg: '$edi'
19; PARSER-NEXT:   arg: 1, reg: '$esi'
20; PARSER-NEXT:   arg: 2, reg: '$edx'
21
22; ModuleID = 'test/CodeGen/X86/call-site-info-output.c'
23source_filename = "test/CodeGen/X86/call-site-info-output.c"
24target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
25target triple = "x86_64-unknown-linux-gnu"
26
27; Function Attrs: noinline nounwind uwtable
28define dso_local i64 @fn2(i32 %a, i32 %b, i32 %c) local_unnamed_addr {
29entry:
30  %call = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @fn1 to i32 (i32, i32, i32, ...)*)(i32 -50, i32 50, i32 -7)
31  %add = mul i32 %a, 3
32  %sub = sub i32 %add, %b
33  %add2 = add i32 %sub, %c
34  %conv4 = sext i32 %add2 to i64
35  ret i64 %conv4
36}
37
38declare dso_local i32 @fn1(...) local_unnamed_addr
39
40!llvm.module.flags = !{!0}
41!llvm.ident = !{!1}
42
43!0 = !{i32 1, !"wchar_size", i32 4}
44!1 = !{!"clang version 9.0.0"}
45