Skip to content

Commit

Permalink
Test that sqrt_llvm_fast intrinsic emits 'fast' tag
Browse files Browse the repository at this point in the history
  • Loading branch information
smallnamespace committed Sep 14, 2019
1 parent 640bb57 commit 00ede87
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/llvmpasses/fastmath.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

# RUN: julia --startup-file=no %s %t && llvm-link -S %t/* -o %t/module.ll
# RUN: cat %t/module.ll | FileCheck %s

## Notes:
# This script uses the `emit` function (defined llvmpasses.jl) to emit either
# optimized or unoptimized LLVM IR. Each function is emitted individually and
# `llvm-link` is used to create a single module that can be passed to opt.
# The order in which files are emitted and linked is important since `lit` will
# process the test cases in order.

include(joinpath("..", "testhelpers", "llvmpasses.jl"))

import Base.FastMath

# CHECK: call fast float @llvm.sqrt.f32(float %0)
emit(FastMath.sqrt_fast, Float32)

0 comments on commit 00ede87

Please sign in to comment.