Fix CMake detection of various cmath functions, and XFAIL the test on platforms that...
[oota-llvm.git] / test / Transforms / ConstProp / half.ll
1 ; RUN: opt -constprop -S < %s | FileCheck %s
2 ; XFAIL: win32, freebsd
3
4 ; CHECK: fabs_call
5 define half @fabs_call() {
6 ; CHECK: ret half 0xH5140
7   %x = call half @llvm.fabs.f16(half -42.0)
8   ret half %x
9 }
10 declare half @llvm.fabs.f16(half %x)
11
12 ; CHECK: exp_call
13 define half @exp_call() {
14 ; CHECK: ret half 0xH4170
15   %x = call half @llvm.exp.f16(half 1.0)
16   ret half %x
17 }
18 declare half @llvm.exp.f16(half %x)
19
20 ; CHECK: sqrt_call
21 define half @sqrt_call() {
22 ; CHECK: ret half 0xH4000
23   %x = call half @llvm.sqrt.f16(half 4.0)
24   ret half %x
25 }
26 declare half @llvm.sqrt.f16(half %x)
27
28 ; CHECK: floor_call
29 define half @floor_call() {
30 ; CHECK: ret half 0xH4000
31   %x = call half @llvm.floor.f16(half 2.5)
32   ret half %x
33 }
34 declare half @llvm.floor.f16(half %x)
35
36 ; CHECK: pow_call
37 define half @pow_call() {
38 ; CHECK: ret half 0xH4400
39   %x = call half @llvm.pow.f16(half 2.0, half 2.0)
40   ret half %x
41 }
42 declare half @llvm.pow.f16(half %x, half %y)
43