r271414 - Disable warning about core features by default
Jan Vesely via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 1 11:04:54 PDT 2016
Author: jvesely
Date: Wed Jun 1 13:04:53 2016
New Revision: 271414
URL: http://llvm.org/viewvc/llvm-project?rev=271414&view=rev
Log:
Disable warning about core features by default
Reviewers: Anastasia, yaxunl
Differential Revision: http://reviews.llvm.org/D20744
Modified:
cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
cfe/trunk/test/Parser/opencl-atomics-cl20.cl
cfe/trunk/test/SemaOpenCL/extension-version.cl
cfe/trunk/test/SemaOpenCL/invalid-logical-ops-1.2.cl
Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=271414&r1=271413&r2=271414&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Wed Jun 1 13:04:53 2016
@@ -929,7 +929,7 @@ def warn_pragma_unknown_extension : Warn
def warn_pragma_unsupported_extension : Warning<
"unsupported OpenCL extension %0 - ignoring">, InGroup<IgnoredPragmas>;
def warn_pragma_extension_is_core : Warning<
- "OpenCL extension %0 is core feature or supported optional core feature - ignoring">, InGroup<IgnoredPragmas>;
+ "OpenCL extension %0 is core feature or supported optional core feature - ignoring">, InGroup<DiagGroup<"pedantic-core-features">>, DefaultIgnore;
// OpenCL errors.
def err_opencl_taking_function_address_parser : Error<
Modified: cfe/trunk/test/Parser/opencl-atomics-cl20.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/opencl-atomics-cl20.cl?rev=271414&r1=271413&r2=271414&view=diff
==============================================================================
--- cfe/trunk/test/Parser/opencl-atomics-cl20.cl (original)
+++ cfe/trunk/test/Parser/opencl-atomics-cl20.cl Wed Jun 1 13:04:53 2016
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 %s -triple spir-unknown-unknown -verify -pedantic -fsyntax-only
// RUN: %clang_cc1 %s -triple spir-unknown-unknown -verify -fsyntax-only -cl-std=CL2.0 -DCL20
-// RUN: %clang_cc1 %s -triple spir-unknown-unknown -verify -fsyntax-only -cl-std=CL2.0 -DCL20 -DEXT
+// RUN: %clang_cc1 %s -triple spir-unknown-unknown -verify -fsyntax-only -cl-std=CL2.0 -DCL20 -DEXT -Wpedantic-core-features
#ifdef EXT
#pragma OPENCL EXTENSION cl_khr_int64_base_atomics:enable
Modified: cfe/trunk/test/SemaOpenCL/extension-version.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaOpenCL/extension-version.cl?rev=271414&r1=271413&r2=271414&view=diff
==============================================================================
--- cfe/trunk/test/SemaOpenCL/extension-version.cl (original)
+++ cfe/trunk/test/SemaOpenCL/extension-version.cl Wed Jun 1 13:04:53 2016
@@ -2,8 +2,12 @@
// RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple spir-unknown-unknown
// RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple spir-unknown-unknown
// RUN: %clang_cc1 -x cl -cl-std=CL2.0 %s -verify -triple spir-unknown-unknown
+// RUN: %clang_cc1 -x cl -cl-std=CL %s -verify -triple spir-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES
+// RUN: %clang_cc1 -x cl -cl-std=CL1.1 %s -verify -triple spir-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES
+// RUN: %clang_cc1 -x cl -cl-std=CL1.2 %s -verify -triple spir-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES
+// RUN: %clang_cc1 -x cl -cl-std=CL2.0 %s -verify -triple spir-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES
-#if __OPENCL_C_VERSION__ >= 200
+#if __OPENCL_C_VERSION__ >= 200 && ! defined TEST_CORE_FEATURES
// expected-no-diagnostics
#endif
@@ -39,56 +43,76 @@
#pragma OPENCL EXTENSION cl_khr_icd: enable
// Core features in CL 1.1
-#if (__OPENCL_C_VERSION__ < 110)
+
#ifndef cl_khr_byte_addressable_store
#error "Missing cl_khr_byte_addressable_store define"
#endif
#pragma OPENCL EXTENSION cl_khr_byte_addressable_store: enable
+#if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
+// expected-warning at -2{{OpenCL extension 'cl_khr_byte_addressable_store' is core feature or supported optional core feature - ignoring}}
+#endif
#ifndef cl_khr_global_int32_base_atomics
#error "Missing cl_khr_global_int32_base_atomics define"
#endif
#pragma OPENCL EXTENSION cl_khr_global_int32_base_atomics: enable
+#if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
+// expected-warning at -2{{OpenCL extension 'cl_khr_global_int32_base_atomics' is core feature or supported optional core feature - ignoring}}
+#endif
#ifndef cl_khr_global_int32_extended_atomics
#error "Missing cl_khr_global_int32_extended_atomics define"
#endif
#pragma OPENCL EXTENSION cl_khr_global_int32_extended_atomics: enable
+#if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
+// expected-warning at -2{{OpenCL extension 'cl_khr_global_int32_extended_atomics' is core feature or supported optional core feature - ignoring}}
+#endif
#ifndef cl_khr_local_int32_base_atomics
#error "Missing cl_khr_local_int32_base_atomics define"
#endif
#pragma OPENCL EXTENSION cl_khr_local_int32_base_atomics: enable
+#if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
+// expected-warning at -2{{OpenCL extension 'cl_khr_local_int32_base_atomics' is core feature or supported optional core feature - ignoring}}
+#endif
#ifndef cl_khr_local_int32_extended_atomics
#error "Missing cl_khr_local_int32_extended_atomics define"
#endif
#pragma OPENCL EXTENSION cl_khr_local_int32_extended_atomics: enable
+#if (__OPENCL_C_VERSION__ >= 110) && defined TEST_CORE_FEATURES
+// expected-warning at -2{{OpenCL extension 'cl_khr_local_int32_extended_atomics' is core feature or supported optional core feature - ignoring}}
+#endif
+#if (__OPENCL_C_VERSION__ < 110)
+// Deprecated abvoe 1.0
#ifndef cl_khr_select_fprounding_mode
#error "Missing cl_khr_select_fp_rounding_mode define"
#endif
#pragma OPENCL EXTENSION cl_khr_select_fprounding_mode: enable
-
#endif
+
// Core feature in CL 1.2
-#if (__OPENCL_C_VERSION__ < 120)
#ifndef cl_khr_fp64
#error "Missing cl_khr_fp64 define"
#endif
#pragma OPENCL EXTENSION cl_khr_fp64: enable
+#if (__OPENCL_C_VERSION__ >= 120) && defined TEST_CORE_FEATURES
+// expected-warning at -2{{OpenCL extension 'cl_khr_fp64' is core feature or supported optional core feature - ignoring}}
#endif
//Core feature in CL 2.0
-#if (__OPENCL_C_VERSION__ < 200)
#ifndef cl_khr_3d_image_writes
#error "Missing cl_khr_3d_image_writes define"
#endif
#pragma OPENCL EXTENSION cl_khr_3d_image_writes: enable
+#if (__OPENCL_C_VERSION__ >= 200) && defined TEST_CORE_FEATURES
+// expected-warning at -2{{OpenCL extension 'cl_khr_3d_image_writes' is core feature or supported optional core feature - ignoring}}
#endif
+
#if (__OPENCL_C_VERSION__ >= 110)
#ifndef cl_khr_gl_event
#error "Missing cl_khr_gl_event define"
Modified: cfe/trunk/test/SemaOpenCL/invalid-logical-ops-1.2.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaOpenCL/invalid-logical-ops-1.2.cl?rev=271414&r1=271413&r2=271414&view=diff
==============================================================================
--- cfe/trunk/test/SemaOpenCL/invalid-logical-ops-1.2.cl (original)
+++ cfe/trunk/test/SemaOpenCL/invalid-logical-ops-1.2.cl Wed Jun 1 13:04:53 2016
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 %s -verify -cl-std=CL1.2 -triple x86_64-unknown-linux-gnu
-#pragma OPENCL EXTENSION cl_khr_fp64 : enable // expected-warning{{OpenCL extension 'cl_khr_fp64' is core feature or supported optional core feature - ignoring}}
+#pragma OPENCL EXTENSION cl_khr_fp64 : enable
typedef __attribute__((ext_vector_type(4))) float float4;
typedef __attribute__((ext_vector_type(4))) double double4;
More information about the cfe-commits
mailing list