46 lines · plain
1; Test call site info MIR printer and parser.Parser assertions and machine2; verifier will check the rest;3; RUN: llc -emit-call-site-info %s -stop-before=finalize-isel -o %t.mir4; RUN: cat %t.mir | FileCheck %s5; CHECK: name: fn26; CHECK: callSites:7; There is no need to verify call instruction location since it will be8; 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=PARSER14; RUN: llc -emit-call-site-info %t.mir -passes=finalize-isel -o -| FileCheck %s --check-prefix=PARSER15; Verify that we are able to parse output mir and that we are getting the same result.16; PARSER: name: fn217; 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 uwtable29define 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, 333 %sub = sub i32 %add, %b34 %add2 = add i32 %sub, %c35 %conv4 = sext i32 %add2 to i6436 ret i64 %conv437}38 39declare dso_local i32 @fn1(...) local_unnamed_addr40 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