|
| 1 | +# Test MIR printer and parser for type id field in callSites. It is used |
| 2 | +# for propogating call site type identifiers to emit in the call graph section. |
| 3 | + |
| 4 | +# RUN: llc --call-graph-section %s -run-pass=none -o - | FileCheck %s |
| 5 | +# CHECK: name: main |
| 6 | +# CHECK: callSites: |
| 7 | +# CHECK-NEXT: - { bb: {{.*}}, offset: {{.*}}, fwdArgRegs: [], typeId: |
| 8 | +# CHECK-NEXT: 123456789 } |
| 9 | + |
| 10 | +--- | |
| 11 | + ; ModuleID = 'test.ll' |
| 12 | + source_filename = "test.ll" |
| 13 | + target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" |
| 14 | + target triple = "x86_64-unknown-linux-gnu" |
| 15 | + |
| 16 | + define dso_local void @foo(i8 signext %a) { |
| 17 | + entry: |
| 18 | + ret void |
| 19 | + } |
| 20 | + |
| 21 | + define dso_local i32 @main() { |
| 22 | + entry: |
| 23 | + %retval = alloca i32, align 4 |
| 24 | + %fp = alloca void (i8)*, align 8 |
| 25 | + store i32 0, i32* %retval, align 4 |
| 26 | + store void (i8)* @foo, void (i8)** %fp, align 8 |
| 27 | + %0 = load void (i8)*, void (i8)** %fp, align 8 |
| 28 | + call void %0(i8 signext 97) |
| 29 | + ret i32 0 |
| 30 | + } |
| 31 | + |
| 32 | +... |
| 33 | +--- |
| 34 | +name: foo |
| 35 | +tracksRegLiveness: true |
| 36 | +body: | |
| 37 | + bb.0.entry: |
| 38 | + RET 0 |
| 39 | +
|
| 40 | +... |
| 41 | +--- |
| 42 | +name: main |
| 43 | +tracksRegLiveness: true |
| 44 | +stack: |
| 45 | + - { id: 0, name: retval, type: default, offset: 0, size: 4, alignment: 4, |
| 46 | + stack-id: default, callee-saved-register: '', callee-saved-restored: true, |
| 47 | + debug-info-variable: '', debug-info-expression: '', debug-info-location: '' } |
| 48 | + - { id: 1, name: fp, type: default, offset: 0, size: 8, alignment: 8, |
| 49 | + stack-id: default, callee-saved-register: '', callee-saved-restored: true, |
| 50 | + debug-info-variable: '', debug-info-expression: '', debug-info-location: '' } |
| 51 | +callSites: |
| 52 | + - { bb: 0, offset: 6, fwdArgRegs: [], typeId: |
| 53 | + 123456789 } |
| 54 | +body: | |
| 55 | + bb.0.entry: |
| 56 | + MOV32mi %stack.0.retval, 1, $noreg, 0, $noreg, 0 :: (store (s32) into %ir.retval) |
| 57 | + MOV64mi32 %stack.1.fp, 1, $noreg, 0, $noreg, @foo :: (store (s64) into %ir.fp) |
| 58 | + %0:gr64 = MOV32ri64 @foo |
| 59 | + ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp |
| 60 | + %1:gr32 = MOV32ri 97 |
| 61 | + $edi = COPY %1 |
| 62 | + CALL64r killed %0, csr_64, implicit $rsp, implicit $ssp, implicit $edi, implicit-def $rsp, implicit-def $ssp |
| 63 | + ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp |
| 64 | + %2:gr32 = MOV32r0 implicit-def dead $eflags |
| 65 | + $eax = COPY %2 |
| 66 | + RET 0, $eax |
| 67 | +
|
| 68 | +... |
0 commit comments