]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGenOpenCL/relaxed-fpmath.cl
Vendor import of clang trunk r238337:
[FreeBSD/FreeBSD.git] / test / CodeGenOpenCL / relaxed-fpmath.cl
1 // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s -check-prefix=NORMAL
2 // RUN: %clang_cc1 %s -emit-llvm -cl-fast-relaxed-math -o - | FileCheck %s -check-prefix=FAST
3 // RUN: %clang_cc1 %s -emit-llvm -cl-finite-math-only -o - | FileCheck %s -check-prefix=FINITE
4 // RUN: %clang_cc1 %s -emit-llvm -cl-unsafe-math-optimizations -o - | FileCheck %s -check-prefix=UNSAFE
5
6 typedef __attribute__(( ext_vector_type(4) )) float float4;
7
8 float spscalardiv(float a, float b) {
9   // CHECK: @spscalardiv(
10
11   // NORMAL: fdiv float    
12   // FAST: fdiv fast float
13   // FINITE: fdiv nnan ninf float
14   // UNSAFE: fdiv nnan float
15   return a / b;
16 }
17 // CHECK: attributes
18
19 // NORMAL: "no-infs-fp-math"="false"
20 // NORMAL: "no-nans-fp-math"="false"
21 // NORMAL: "unsafe-fp-math"="false"
22
23 // FAST: "no-infs-fp-math"="true"
24 // FAST: "no-nans-fp-math"="true"
25 // FAST: "unsafe-fp-math"="true"
26
27 // FINITE: "no-infs-fp-math"="true"
28 // FINITE: "no-nans-fp-math"="true"
29 // FINITE: "unsafe-fp-math"="false"
30
31 // UNSAFE: "no-infs-fp-math"="false"
32 // UNSAFE: "no-nans-fp-math"="true"
33 // UNSAFE: "unsafe-fp-math"="true"
34