linux-packaging-mono/external/llvm/test/CodeGen/X86/x86-64-flags-intrinsics.ll
Xamarin Public Jenkins (auto-signing) e19d552987 Imported Upstream version 5.18.0.161
Former-commit-id: 4db48158d3a35497b8f118ab21b5f08ac3d86d98
2018-10-19 08:34:24 +00:00

38 lines
890 B
LLVM

; RUN: llc -verify-machineinstrs < %s | FileCheck %s
target triple = "x86_64-pc-win32"
declare i64 @llvm.x86.flags.read.u64()
declare void @llvm.x86.flags.write.u64(i64)
define i64 @read_flags() {
entry:
%flags = call i64 @llvm.x86.flags.read.u64()
ret i64 %flags
}
; CHECK-LABEL: read_flags:
; CHECK: pushq %rbp
; CHECK: .seh_pushreg 5
; CHECK: movq %rsp, %rbp
; CHECK: .seh_setframe 5, 0
; CHECK: .seh_endprologue
; CHECK-NEXT: pushfq
; CHECK-NEXT: popq %rax
; CHECK-NEXT: popq %rbp
define void @write_flags(i64 %arg) {
entry:
call void @llvm.x86.flags.write.u64(i64 %arg)
ret void
}
; CHECK-LABEL: write_flags:
; CHECK: pushq %rbp
; CHECK: .seh_pushreg 5
; CHECK: movq %rsp, %rbp
; CHECK: .seh_setframe 5, 0
; CHECK: .seh_endprologue
; CHECK-NEXT: pushq %rcx
; CHECK-NEXT: popfq
; CHECK-NEXT: popq %rbp