summaryrefslogtreecommitdiffstats
path: root/test/SemaOpenCL
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-03-11 19:24:59 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2011-03-11 19:24:59 +0000
commitf4f7cb814f8537606754b9eb8848094196e73214 (patch)
treef99eb6f1159e410506632bec2b04447e3119f2e3 /test/SemaOpenCL
parentf4e3cfbe8abd124be6341ef5d714819b4fbd9082 (diff)
OpenCL: if double precision floating point constant encountered
without cl_khr_fp64, warn and cast to single precision git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127476 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaOpenCL')
-rw-r--r--test/SemaOpenCL/extension-fp64.cl8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/SemaOpenCL/extension-fp64.cl b/test/SemaOpenCL/extension-fp64.cl
index eaf2509502..e0c2b1ea4b 100644
--- a/test/SemaOpenCL/extension-fp64.cl
+++ b/test/SemaOpenCL/extension-fp64.cl
@@ -1,17 +1,19 @@
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
-void f1(double da) { // expected-error {{requires cl_khr_fp64 extension}}
- double d; // expected-error {{requires cl_khr_fp64 extension}}
+void f1(double da) { // expected-error {{type 'double' requires cl_khr_fp64 extension}}
+ double d; // expected-error {{type 'double' requires cl_khr_fp64 extension}}
+ (void) 1.0; // expected-warning {{double precision constant requires cl_khr_fp64}}
}
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
void f2(void) {
double d;
+ (void) 1.0;
}
#pragma OPENCL EXTENSION cl_khr_fp64 : disable
void f3(void) {
- double d; // expected-error {{requires cl_khr_fp64 extension}}
+ double d; // expected-error {{type 'double' requires cl_khr_fp64 extension}}
}