diff --git a/clang/lib/Headers/opencl-c-base.h b/clang/lib/Headers/opencl-c-base.h index 1dc52ec75e03..7c724bc2e7a9 100644 --- a/clang/lib/Headers/opencl-c-base.h +++ b/clang/lib/Headers/opencl-c-base.h @@ -169,9 +169,7 @@ typedef double double8 __attribute__((ext_vector_type(8))); typedef double double16 __attribute__((ext_vector_type(16))); #endif -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) #define NULL ((void*)0) -#endif /** * Value of maximum non-infinite single-precision floating-point diff --git a/clang/test/SemaOpenCL/null_literal.cl b/clang/test/SemaOpenCL/null_literal.cl index e84228a06fc4..f4d55d70aaf8 100644 --- a/clang/test/SemaOpenCL/null_literal.cl +++ b/clang/test/SemaOpenCL/null_literal.cl @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -verify %s -// RUN: %clang_cc1 -cl-std=CL2.0 -verify %s - -#define NULL ((void*)0) +// RUN: %clang_cc1 -cl-std=CL1.0 -fdeclare-opencl-builtins -finclude-default-header -verify %s +// RUN: %clang_cc1 -cl-std=CL1.1 -fdeclare-opencl-builtins -finclude-default-header -verify %s +// RUN: %clang_cc1 -cl-std=CL1.2 -fdeclare-opencl-builtins -finclude-default-header -verify %s +// RUN: %clang_cc1 -cl-std=CL2.0 -fdeclare-opencl-builtins -finclude-default-header -verify %s void foo(){