From 00ede877c3f0da668d8361b1158f835ca6a054bf Mon Sep 17 00:00:00 2001 From: smallnamespace Date: Sat, 14 Sep 2019 02:20:12 -0700 Subject: [PATCH] Test that sqrt_llvm_fast intrinsic emits 'fast' tag --- test/llvmpasses/fastmath.jl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/llvmpasses/fastmath.jl diff --git a/test/llvmpasses/fastmath.jl b/test/llvmpasses/fastmath.jl new file mode 100644 index 0000000000000..4e0d35e300d5c --- /dev/null +++ b/test/llvmpasses/fastmath.jl @@ -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)