[Codegen] Adjust saturation test. NFC.
[llvm-core.git] / test / CodeGen / X86 / retpoline-regparm.ll
blob668047c3891741cf89698238d6ce7986ee7de63b
1 ; RUN: llc -verify-machineinstrs -mtriple=i686-linux < %s | FileCheck --implicit-check-not="jmp.*\*" --implicit-check-not="call.*\*" %s
3 ; Test 32-bit retpoline when -mregparm=3 is used. This case is interesting
4 ; because there are no available scratch registers.  The Linux kernel builds
5 ; with -mregparm=3, so we need to support it.  TCO should fail because we need
6 ; to restore EDI.
8 define void @call_edi(void (i32, i32, i32)* %fp) #0 {
9 entry:
10   tail call void %fp(i32 inreg 0, i32 inreg 0, i32 inreg 0)
11   ret void
14 ; CHECK-LABEL: call_edi:
15 ;     EDI is used, so it must be saved.
16 ; CHECK: pushl %edi
17 ; CHECK-DAG: xorl %eax, %eax
18 ; CHECK-DAG: xorl %edx, %edx
19 ; CHECK-DAG: xorl %ecx, %ecx
20 ; CHECK-DAG: movl {{.*}}, %edi
21 ; CHECK: calll __llvm_retpoline_edi
22 ; CHECK: popl %edi
23 ; CHECK: retl
25 define void @edi_external(void (i32, i32, i32)* %fp) #1 {
26 entry:
27   tail call void %fp(i32 inreg 0, i32 inreg 0, i32 inreg 0)
28   ret void
31 ; CHECK-LABEL: edi_external:
32 ; CHECK: pushl %edi
33 ; CHECK-DAG: xorl %eax, %eax
34 ; CHECK-DAG: xorl %edx, %edx
35 ; CHECK-DAG: xorl %ecx, %ecx
36 ; CHECK-DAG: movl {{.*}}, %edi
37 ; CHECK: calll __x86_indirect_thunk_edi
38 ; CHECK: popl %edi
39 ; CHECK: retl
41 attributes #0 = { "target-features"="+retpoline-indirect-calls" }
42 attributes #1 = { "target-features"="+retpoline-indirect-calls,+retpoline-external-thunk" }