From dbe13110f59f48b4dbb7552b3ac2935acdeece7f Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 14 Apr 2012 14:01:31 +0000 Subject: Vendor import of clang trunk r154661: http://llvm.org/svn/llvm-project/cfe/trunk@r154661 --- test/CodeGenOpenCL/fpaccuracy.cl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/CodeGenOpenCL/fpaccuracy.cl (limited to 'test/CodeGenOpenCL/fpaccuracy.cl') diff --git a/test/CodeGenOpenCL/fpaccuracy.cl b/test/CodeGenOpenCL/fpaccuracy.cl new file mode 100644 index 000000000000..d27316a799f3 --- /dev/null +++ b/test/CodeGenOpenCL/fpaccuracy.cl @@ -0,0 +1,25 @@ +// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s + +typedef __attribute__(( ext_vector_type(4) )) float float4; + +float spscalardiv(float a, float b) { + // CHECK: @spscalardiv + // CHECK: fdiv{{.*}}, !fpaccuracy ![[MD:[0-9]+]] + return a / b; +} + +float4 spvectordiv(float4 a, float4 b) { + // CHECK: @spvectordiv + // CHECK: fdiv{{.*}}, !fpaccuracy ![[MD]] + return a / b; +} + +#pragma OPENCL EXTENSION cl_khr_fp64 : enable + +double dpscalardiv(double a, double b) { + // CHECK: @dpscalardiv + // CHECK-NOT: !fpaccuracy + return a / b; +} + +// CHECK: ![[MD]] = metadata !{float 2.500000e+00} -- cgit v1.3