Index: test/Driver/include-default-header.cl =================================================================== --- test/Driver/include-default-header.cl +++ test/Driver/include-default-header.cl @@ -1,5 +1,6 @@ -// RUN: %clang -save-temps -x cl -Xclang -cl-std=CL2.0 -Xclang -finclude-default-header -emit-llvm -S -### %s -// CHECK-NOT: finclude-default-header +// RUN: %clang -save-temps -x cl -Xclang -cl-std=CL2.0 -Xclang -finclude-default-header -emit-llvm -S -### %s 2>&1 | FileCheck %s + +// CHECK-LABEL: finclude-default-header // Make sure we don't pass -finclude-default-header to any commands other than the driver. void test() {} Index: test/Headers/opencl-c-header.cl =================================================================== --- test/Headers/opencl-c-header.cl +++ test/Headers/opencl-c-header.cl @@ -1,6 +1,7 @@ // RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify | FileCheck %s -// RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify -cl-std=CL1.1| FileCheck %s -// RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify -cl-std=CL1.2| FileCheck %s +// RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify -cl-std=CL1.1 | FileCheck %s +// RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify -cl-std=CL1.2 | FileCheck %s +// RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify -cl-std=c++ | FileCheck %s --check-prefix=CHECK20 // Test including the default header as a module. // The module should be compiled only once and loaded from cache afterwards. @@ -54,7 +55,7 @@ // CHECK20: _Z3ctzc // CHECK20-NOT: _Z16convert_char_rtec char f(char x) { -#if __OPENCL_C_VERSION__ != CL_VERSION_2_0 +#if !defined(__OPENCL_CPP_VERSION__) && (__OPENCL_C_VERSION__ != CL_VERSION_2_0) return convert_char_rte(x); #else //__OPENCL_C_VERSION__ @@ -67,7 +68,7 @@ // from OpenCL 2.0 onwards. // CHECK20: _Z12write_imagef14ocl_image3d_wo -#if __OPENCL_C_VERSION__ >= CL_VERSION_2_0 +#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) void test_image3dwo(write_only image3d_t img) { write_imagef(img, (0), (0.0f)); } @@ -75,7 +76,7 @@ // Verify that non-builtin cl_intel_planar_yuv extension is defined from // OpenCL 1.2 onwards. -#if (__OPENCL_C_VERSION__ >= CL_VERSION_1_2) +#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_1_2) // expected-no-diagnostics #ifndef cl_intel_planar_yuv #error "Missing cl_intel_planar_yuv define" Index: test/SemaOpenCL/builtin.cl =================================================================== --- test/SemaOpenCL/builtin.cl +++ test/SemaOpenCL/builtin.cl @@ -1,4 +1,5 @@ // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2 +// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=c++ // expected-no-diagnostics Index: test/SemaOpenCL/extensions.cl =================================================================== --- test/SemaOpenCL/extensions.cl +++ test/SemaOpenCL/extensions.cl @@ -28,7 +28,7 @@ // enabled by default with -cl-std=CL2.0). // // RUN: %clang_cc1 %s -triple amdgcn-unknown-unknown -verify -pedantic -fsyntax-only -cl-std=CL2.0 -finclude-default-header -// RUN: %clang_cc1 %s -triple spir-unknown-unknown -verify -pedantic -fsyntax-only -cl-std=c++ -finclude-default-header +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -verify -pedantic -fsyntax-only -cl-std=c++ #ifdef _OPENCL_H_ // expected-no-diagnostics