[flang] Support OPEN(..., FORM="BINARY") (#124657)
[llvm-project.git] / lld / test / MachO / lto-mattrs.ll
blobf658b485a1792392d8c69d49a799b439431a0f7e
1 ; REQUIRES: x86
2 ; RUN: llvm-as %s -o %t.o
4 ;; Verify that LTO behavior can be tweaked using -mattr.
6 ; RUN: %lld -mcpu haswell -mllvm -mattr=+fma %t.o -o %t.dylib -dylib
7 ; RUN: llvm-objdump --no-print-imm-hex -d --section="__text" --no-leading-addr --no-show-raw-insn %t.dylib | FileCheck %s --check-prefix=FMA
9 ; RUN: %lld -mcpu haswell -mllvm -mattr=-fma %t.o -o %t.dylib -dylib
10 ; RUN: llvm-objdump --no-print-imm-hex -d --section="__text" --no-leading-addr --no-show-raw-insn %t.dylib | FileCheck %s --check-prefix=NO-FMA
12 ; FMA:      <_foo>:
13 ; FMA-NEXT: vrcpss       %xmm0, %xmm0, %xmm1
14 ; FMA-NEXT: vfmsub213ss  [[#]](%rip), %xmm1, %xmm0 ## xmm0 = (xmm1 * xmm0) - mem
15 ; FMA-NEXT:                                        ## 0x
16 ; FMA-NEXT: vfnmadd132ss %xmm1, %xmm1, %xmm0
17 ; FMA-NEXT: retq
19 ; NO-FMA:      <_foo>:
20 ; NO-FMA-NEXT: vrcpss %xmm0, %xmm0, %xmm1
21 ; NO-FMA-NEXT: vmulss %xmm1, %xmm0, %xmm0
22 ; NO-FMA-NEXT: vmovss [[#]](%rip), %xmm2  ## 0x
23 ; NO-FMA-NEXT: vsubss %xmm0, %xmm2, %xmm0
24 ; NO-FMA-NEXT: vmulss %xmm0, %xmm1, %xmm0
25 ; NO-FMA-NEXT: vaddss %xmm0, %xmm1, %xmm0
26 ; NO-FMA-NEXT: retq
28 target triple = "x86_64-apple-darwin"
29 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
31 define float @foo(float %x) #0 {
32   %div = fdiv fast float 1.0, %x
33   ret float %div
36 attributes #0 = { "unsafe-fp-math"="true" "reciprocal-estimates"="divf,vec-divf" }