1 ; RUN: llc -verify-machineinstrs < %s | FileCheck %s 2 target triple = "i686-pc-win32" 3 4 declare i32 @llvm.x86.flags.read.u32() 5 declare void @llvm.x86.flags.write.u32(i32) 6 7 define i32 @read_flags() { 8 entry: 9 %flags = call i32 @llvm.x86.flags.read.u32() 10 ret i32 %flags 11 } 12 13 ; CHECK-LABEL: _read_flags: 14 ; CHECK: pushl %ebp 15 ; CHECK-NEXT: movl %esp, %ebp 16 ; CHECK-NEXT: pushfl 17 ; CHECK-NEXT: popl %eax 18 ; CHECK-NEXT: popl %ebp 19 20 define x86_fastcallcc void @write_flags(i32 inreg %arg) { 21 entry: 22 call void @llvm.x86.flags.write.u32(i32 %arg) 23 ret void 24 } 25 26 ; CHECK-LABEL: @write_flags@4: 27 ; CHECK: pushl %ebp 28 ; CHECK-NEXT: movl %esp, %ebp 29 ; CHECK-NEXT: pushl %ecx 30 ; CHECK-NEXT: popfl 31 ; CHECK-NEXT: popl %ebp 32