2015-07-23 20:23:45 +08:00
|
|
|
; RUN: llc < %s -mtriple=i686-windows | FileCheck %s -check-prefix=CHECK -check-prefix=NORMAL
|
|
|
|
; RUN: llc < %s -mtriple=i686-windows -mattr=call-reg-indirect | FileCheck %s -check-prefix=CHECK -check-prefix=SLM
|
|
|
|
|
|
|
|
declare void @foo(i32 %r)
|
|
|
|
|
2015-11-03 16:17:25 +08:00
|
|
|
define void @test(i32 %a, i32 %b) optsize nounwind {
|
2015-07-23 20:23:45 +08:00
|
|
|
; CHECK-LABEL: test:
|
|
|
|
; CHECK: movl [[EAX:%e..]], (%esp)
|
|
|
|
; CHECK-NEXT: pushl [[EAX]]
|
|
|
|
; CHECK-NEXT: calll
|
|
|
|
; CHECK-NEXT: addl $4, %esp
|
|
|
|
; CHECK: nop
|
|
|
|
; NORMAL: pushl (%esp)
|
|
|
|
; SLM: movl (%esp), [[RELOAD:%e..]]
|
|
|
|
; SLM-NEXT: pushl [[RELOAD]]
|
|
|
|
; CHECK: calll
|
2016-04-07 00:10:20 +08:00
|
|
|
; CHECK-NEXT: addl $4, %esp
|
2015-07-23 20:23:45 +08:00
|
|
|
%c = add i32 %a, %b
|
|
|
|
call void @foo(i32 %c)
|
|
|
|
call void asm sideeffect "nop", "~{ax},~{bx},~{cx},~{dx},~{bp},~{si},~{di}"()
|
|
|
|
call void @foo(i32 %c)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-11-03 16:17:25 +08:00
|
|
|
define void @test_min(i32 %a, i32 %b) minsize nounwind {
|
2015-07-23 20:23:45 +08:00
|
|
|
; CHECK-LABEL: test_min:
|
|
|
|
; CHECK: movl [[EAX:%e..]], (%esp)
|
|
|
|
; CHECK-NEXT: pushl [[EAX]]
|
|
|
|
; CHECK-NEXT: calll
|
2015-08-11 16:48:48 +08:00
|
|
|
; CHECK-NEXT: popl
|
2015-07-23 20:23:45 +08:00
|
|
|
; CHECK: nop
|
|
|
|
; CHECK: pushl (%esp)
|
|
|
|
; CHECK: calll
|
2015-08-11 16:48:48 +08:00
|
|
|
; CHECK-NEXT: popl
|
2015-07-23 20:23:45 +08:00
|
|
|
%c = add i32 %a, %b
|
|
|
|
call void @foo(i32 %c)
|
|
|
|
call void asm sideeffect "nop", "~{ax},~{bx},~{cx},~{dx},~{bp},~{si},~{di}"()
|
|
|
|
call void @foo(i32 %c)
|
|
|
|
ret void
|
|
|
|
}
|