brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.8 KiB · 075b3c3 Raw
129 lines · plain
1# RUN: llc -mtriple=i686-windows --run-pass="x86-cf-opt" %s -o - | FileCheck %s2 3# PR349034--- |5  target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"6  target triple = "i686--windows-msvc"7 8  %struct.s = type { i64 }9 10  declare void @good(i32, i32, i32, i32)11 12  declare void @struct(ptr byval(%struct.s), i32, i32, i32)13 14  ; Function Attrs: optsize15  define void @test9() #0 {16  entry:17    %p = alloca i32, align 418    %q = alloca i32, align 419    %s = alloca %struct.s, align 420    call void @good(i32 1, i32 2, i32 3, i32 4)21    %pv = ptrtoint ptr %p to i3222    %qv = ptrtoint ptr %q to i3223    call void @struct(ptr byval(%struct.s) %s, i32 6, i32 %qv, i32 %pv)24    ret void25  }26 27  ; Function Attrs: nounwind28  declare void @llvm.stackprotector(ptr, ptr) #129 30  attributes #0 = { optsize }31  attributes #1 = { nounwind }32 33...34---35# CHECK-LABEL: test936# CHECK:      ADJCALLSTACKDOWN32 16, 0, 16, implicit-def dead $esp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $esp, implicit $ssp37# CHECK-NEXT: PUSH32i 4, implicit-def $esp, implicit $esp38# CHECK-NEXT: PUSH32i 3, implicit-def $esp, implicit $esp39# CHECK-NEXT: PUSH32i 2, implicit-def $esp, implicit $esp40# CHECK-NEXT: PUSH32i 1, implicit-def $esp, implicit $esp41# CHECK-NEXT: CALLpcrel32 @good, csr_32, implicit $esp, implicit $ssp, implicit-def $esp, implicit-def $ssp42# CHECK-NEXT: ADJCALLSTACKUP32 16, 0, implicit-def dead $esp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $esp, implicit $ssp43# CHECK-NEXT: ADJCALLSTACKDOWN32 20, 0, 20, implicit-def dead $esp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $esp, implicit $ssp44# CHECK-NEXT: %1:gr32 = MOV32rm %stack.2.s, 1, $noreg, 0, $noreg :: (load (s32) from %stack.2.s, align 8)45# CHECK-NEXT: %2:gr32 = MOV32rm %stack.2.s, 1, $noreg, 4, $noreg :: (load (s32) from %stack.2.s + 4)46# CHECK-NEXT: %4:gr32 = LEA32r %stack.0.p, 1, $noreg, 0, $noreg47# CHECK-NEXT: %5:gr32 = LEA32r %stack.1.q, 1, $noreg, 0, $noreg48# CHECK-NEXT: PUSH32r %4, implicit-def $esp, implicit $esp49# CHECK-NEXT: PUSH32r %5, implicit-def $esp, implicit $esp50# CHECK-NEXT: PUSH32i 6, implicit-def $esp, implicit $esp51# CHECK-NEXT: PUSH32r %2, implicit-def $esp, implicit $esp52# CHECK-NEXT: PUSH32r %1, implicit-def $esp, implicit $esp53# CHECK-NEXT: CALLpcrel32 @struct, csr_32, implicit $esp, implicit $ssp, implicit-def $esp, implicit-def $ssp54# CHECK-NEXT: ADJCALLSTACKUP32 20, 0, implicit-def dead $esp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $esp, implicit $ssp55# CHECK-NEXT: RET 056name:            test957alignment:       158exposesReturnsTwice: false59legalized:       false60regBankSelected: false61selected:        false62tracksRegLiveness: true63registers:64  - { id: 0, class: gr32, preferred-register: '' }65  - { id: 1, class: gr32, preferred-register: '' }66  - { id: 2, class: gr32, preferred-register: '' }67  - { id: 3, class: gr32, preferred-register: '' }68  - { id: 4, class: gr32, preferred-register: '' }69  - { id: 5, class: gr32, preferred-register: '' }70liveins:71frameInfo:72  isFrameAddressTaken: false73  isReturnAddressTaken: false74  hasStackMap:     false75  hasPatchPoint:   false76  stackSize:       077  offsetAdjustment: 078  maxAlignment:    879  adjustsStack:    false80  hasCalls:        true81  stackProtector:  ''82  maxCallFrameSize: 429496729583  hasOpaqueSPAdjustment: false84  hasVAStart:      false85  hasMustTailInVarArgFunc: false86  savePoint:       []87  restorePoint:    []88fixedStack:89stack:90  - { id: 0, name: p, type: default, offset: 0, size: 4, alignment: 4,91      stack-id: default, callee-saved-register: '', callee-saved-restored: true,92      debug-info-variable: '', debug-info-expression: '',93      debug-info-location: '' }94  - { id: 1, name: q, type: default, offset: 0, size: 4, alignment: 4,95      stack-id: default, callee-saved-register: '', callee-saved-restored: true,96      debug-info-variable: '', debug-info-expression: '',97      debug-info-location: '' }98  - { id: 2, name: s, type: default, offset: 0, size: 8, alignment: 8,99      stack-id: default, callee-saved-register: '', callee-saved-restored: true,100      debug-info-variable: '', debug-info-expression: '',101      debug-info-location: '' }102constants:103body:             |104  bb.0.entry:105    ADJCALLSTACKDOWN32 16, 0, 0, implicit-def dead $esp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $esp, implicit $ssp106    %0 = COPY $esp107    MOV32mi %0, 1, $noreg, 12, $noreg, 4 :: (store (s32) into stack + 12)108    MOV32mi %0, 1, $noreg, 8, $noreg, 3 :: (store (s32) into stack + 8)109    MOV32mi %0, 1, $noreg, 4, $noreg, 2 :: (store (s32) into stack + 4)110    MOV32mi %0, 1, $noreg, 0, $noreg, 1 :: (store (s32) into stack)111    CALLpcrel32 @good, csr_32, implicit $esp, implicit $ssp, implicit-def $esp, implicit-def $ssp112    ADJCALLSTACKUP32 16, 0, implicit-def dead $esp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $esp, implicit $ssp113    ADJCALLSTACKDOWN32 20, 0, 0, implicit-def dead $esp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $esp, implicit $ssp114    %1 = MOV32rm %stack.2.s, 1, $noreg, 0, $noreg :: (load (s32) from %stack.2.s, align 8)115    %2 = MOV32rm %stack.2.s, 1, $noreg, 4, $noreg :: (load (s32) from %stack.2.s + 4)116    %3 = COPY $esp117    MOV32mr %3, 1, $noreg, 4, $noreg, killed %2 :: (store (s32))118    MOV32mr %3, 1, $noreg, 0, $noreg, killed %1 :: (store (s32))119    %4 = LEA32r %stack.0.p, 1, $noreg, 0, $noreg120    MOV32mr %3, 1, $noreg, 16, $noreg, killed %4 :: (store (s32) into stack + 16)121    %5 = LEA32r %stack.1.q, 1, $noreg, 0, $noreg122    MOV32mr %3, 1, $noreg, 12, $noreg, killed %5 :: (store (s32) into stack + 12)123    MOV32mi %3, 1, $noreg, 8, $noreg, 6 :: (store (s32) into stack + 8)124    CALLpcrel32 @struct, csr_32, implicit $esp, implicit $ssp, implicit-def $esp, implicit-def $ssp,125    ADJCALLSTACKUP32 20, 0, implicit-def dead $esp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $esp, implicit $ssp126    RET 0127 128...129