Index: include/clang/Driver/Options.td =================================================================== --- include/clang/Driver/Options.td +++ include/clang/Driver/Options.td @@ -518,7 +518,7 @@ def cl_no_signed_zeros : Flag<["-"], "cl-no-signed-zeros">, Group, Flags<[CC1Option]>, HelpText<"OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.">; def cl_std_EQ : Joined<["-"], "cl-std=">, Group, Flags<[CC1Option]>, - HelpText<"OpenCL language standard to compile for.">, Values<"cl,CL,cl1.1,CL1.1,cl1.2,CL1.2,cl2.0,CL2.0,c++">; + HelpText<"OpenCL language standard to compile for.">, Values<"cl,CL,cl1.1,CL1.1,cl1.2,CL1.2,cl2.0,CL2.0,clc++,CLC++">; def cl_denorms_are_zero : Flag<["-"], "cl-denorms-are-zero">, Group, Flags<[CC1Option]>, HelpText<"OpenCL only. Allow denormals to be flushed to zero.">; def cl_fp32_correctly_rounded_divide_sqrt : Flag<["-"], "cl-fp32-correctly-rounded-divide-sqrt">, Group, Flags<[CC1Option]>, Index: include/clang/Frontend/LangStandards.def =================================================================== --- include/clang/Frontend/LangStandards.def +++ include/clang/Frontend/LangStandards.def @@ -174,6 +174,7 @@ LANGSTANDARD_ALIAS_DEPR(opencl11, "CL1.1") LANGSTANDARD_ALIAS_DEPR(opencl12, "CL1.2") LANGSTANDARD_ALIAS_DEPR(opencl20, "CL2.0") +LANGSTANDARD_ALIAS_DEPR(openclcpp, "CLC++") // CUDA LANGSTANDARD(cuda, "cuda", CUDA, "NVIDIA CUDA(tm)", Index: lib/Frontend/CompilerInvocation.cpp =================================================================== --- lib/Frontend/CompilerInvocation.cpp +++ lib/Frontend/CompilerInvocation.cpp @@ -2431,7 +2431,7 @@ .Cases("cl1.1", "CL1.1", LangStandard::lang_opencl11) .Cases("cl1.2", "CL1.2", LangStandard::lang_opencl12) .Cases("cl2.0", "CL2.0", LangStandard::lang_opencl20) - .Case("c++", LangStandard::lang_openclcpp) + .Cases("clc++", "CLC++", LangStandard::lang_openclcpp) .Default(LangStandard::lang_unspecified); if (OpenCLLangStd == LangStandard::lang_unspecified) { Index: test/CodeGenCXX/mangle-address-space.cpp =================================================================== --- test/CodeGenCXX/mangle-address-space.cpp +++ test/CodeGenCXX/mangle-address-space.cpp @@ -1,7 +1,7 @@ // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s --check-prefixes=CHECK,CHECKNOOCL // RUN: %clang_cc1 -emit-llvm -triple x86_64-windows-msvc -o - %s | FileCheck %s --check-prefixes=WIN,WINNOOCL -// RUN: %clang_cc1 -cl-std=c++ -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s --check-prefixes=CHECK,CHECKOCL -// RUN: %clang_cc1 -cl-std=c++ -emit-llvm -triple x86_64-windows-msvc -o - %s | FileCheck %s --check-prefixes=WIN,WINOCL +// RUN: %clang_cc1 -cl-std=clc++ -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s --check-prefixes=CHECK,CHECKOCL +// RUN: %clang_cc1 -cl-std=clc++ -emit-llvm -triple x86_64-windows-msvc -o - %s | FileCheck %s --check-prefixes=WIN,WINOCL // CHECKNOOCL-LABEL: define {{.*}}void @_Z2f0Pc // WINNOOCL-LABEL: define {{.*}}void @"?f0@@YAXPEAD@Z" Index: test/CodeGenOpenCL/builtins.cl =================================================================== --- test/CodeGenOpenCL/builtins.cl +++ test/CodeGenOpenCL/builtins.cl @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -finclude-default-header -cl-std=c++ -fblocks -O0 -emit-llvm -o - -triple "spir-unknown-unknown" | FileCheck %s +// RUN: %clang_cc1 %s -finclude-default-header -cl-std=clc++ -fblocks -O0 -emit-llvm -o - -triple "spir-unknown-unknown" | FileCheck %s void testBranchingOnEnqueueKernel(queue_t default_queue, unsigned flags, ndrange_t ndrange) { // Ensure `enqueue_kernel` can be branched upon. Index: test/CodeGenOpenCL/images.cl =================================================================== --- test/CodeGenOpenCL/images.cl +++ test/CodeGenOpenCL/images.cl @@ -1,5 +1,5 @@ // RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -O0 -emit-llvm -o - | FileCheck %s -// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -O0 -emit-llvm -o - -cl-std=c++ | FileCheck %s +// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -O0 -emit-llvm -o - -cl-std=clc++ | FileCheck %s __attribute__((overloadable)) void read_image(read_only image1d_t img_ro); __attribute__((overloadable)) void read_image(write_only image1d_t img_wo); Index: test/CodeGenOpenCL/logical-ops.cl =================================================================== --- test/CodeGenOpenCL/logical-ops.cl +++ test/CodeGenOpenCL/logical-ops.cl @@ -1,5 +1,5 @@ // RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=CL1.2 -O1 -triple x86_64-unknown-linux-gnu | FileCheck %s -// RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=c++ -O1 -triple x86_64-unknown-linux-gnu | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=clc++ -O1 -triple x86_64-unknown-linux-gnu | FileCheck %s #pragma OPENCL EXTENSION cl_khr_fp64 : enable Index: test/CodeGenOpenCL/pipe_builtin.cl =================================================================== --- test/CodeGenOpenCL/pipe_builtin.cl +++ test/CodeGenOpenCL/pipe_builtin.cl @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -cl-ext=+cl_khr_subgroups -O0 -cl-std=c++ -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -cl-ext=+cl_khr_subgroups -O0 -cl-std=clc++ -o - %s | FileCheck %s // FIXME: Add MS ABI manglings of OpenCL things and remove %itanium_abi_triple // above to support OpenCL in the MS C++ ABI. Index: test/CodeGenOpenCL/sampler.cl =================================================================== --- test/CodeGenOpenCL/sampler.cl +++ test/CodeGenOpenCL/sampler.cl @@ -1,6 +1,6 @@ // RUN: %clang_cc1 %s -emit-llvm -triple spir-unknown-unknown -o - -O0 | FileCheck %s // RUN: %clang_cc1 %s -cl-std=CL2.0 -emit-llvm -triple spir-unknown-unknown -o - -O0 | FileCheck %s -// RUN: %clang_cc1 %s -cl-std=c++ -emit-llvm -triple spir-unknown-unknown -o - -O0 | FileCheck %s +// RUN: %clang_cc1 %s -cl-std=clc++ -emit-llvm -triple spir-unknown-unknown -o - -O0 | FileCheck %s // // This test covers 5 cases of sampler initialzation: // 1. function argument passing Index: test/CodeGenOpenCL/spir_version.cl =================================================================== --- test/CodeGenOpenCL/spir_version.cl +++ test/CodeGenOpenCL/spir_version.cl @@ -6,7 +6,7 @@ // RUN: %clang_cc1 %s -triple "spir64-unknown-unknown" -emit-llvm -o - -cl-std=CL2.0 | FileCheck %s --check-prefix=CHECK-SPIR-CL20 -// RUN: %clang_cc1 %s -triple "spir64-unknown-unknown" -emit-llvm -o - -cl-std=c++ | FileCheck %s --check-prefix=CHECK-SPIR-CL20 +// RUN: %clang_cc1 %s -triple "spir64-unknown-unknown" -emit-llvm -o - -cl-std=clc++ | FileCheck %s --check-prefix=CHECK-SPIR-CL20 // RUN: %clang_cc1 %s -triple "amdgcn--amdhsa" -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-AMDGCN-CL10 // RUN: %clang_cc1 %s -triple "amdgcn--amdhsa" -emit-llvm -o - -cl-std=CL1.2 | FileCheck %s --check-prefix=CHECK-AMDGCN-CL12 Index: test/CodeGenOpenCL/to_addr_builtin.cl =================================================================== --- test/CodeGenOpenCL/to_addr_builtin.cl +++ test/CodeGenOpenCL/to_addr_builtin.cl @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple spir-unknown-unknown -emit-llvm -O0 -cl-std=c++ -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple spir-unknown-unknown -emit-llvm -O0 -cl-std=clc++ -o - %s | FileCheck %s // CHECK: %[[A:.*]] = type { float, float, float } typedef struct { Index: test/CodeGenOpenCLCXX/address-space-castoperators.cpp =================================================================== --- test/CodeGenOpenCLCXX/address-space-castoperators.cpp +++ test/CodeGenOpenCLCXX/address-space-castoperators.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -emit-llvm -O0 -o - | FileCheck %s +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -emit-llvm -O0 -o - | FileCheck %s void test_reinterpret_cast(){ __private float x; Index: test/CodeGenOpenCLCXX/address-space-deduction.cl =================================================================== --- test/CodeGenOpenCLCXX/address-space-deduction.cl +++ test/CodeGenOpenCLCXX/address-space-deduction.cl @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -O0 -emit-llvm -o - | FileCheck %s -check-prefixes=COMMON,PTR -// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -O0 -emit-llvm -o - -DREF | FileCheck %s -check-prefixes=COMMON,REF +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -O0 -emit-llvm -o - | FileCheck %s -check-prefixes=COMMON,PTR +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -O0 -emit-llvm -o - -DREF | FileCheck %s -check-prefixes=COMMON,REF #ifdef REF #define PTR & Index: test/CodeGenOpenCLCXX/address-space-deduction2.cl =================================================================== --- test/CodeGenOpenCLCXX/address-space-deduction2.cl +++ test/CodeGenOpenCLCXX/address-space-deduction2.cl @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -O0 -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -O0 -emit-llvm -o - | FileCheck %s class P { public: Index: test/CodeGenOpenCLCXX/addrspace-conversion.cl =================================================================== --- test/CodeGenOpenCLCXX/addrspace-conversion.cl +++ test/CodeGenOpenCLCXX/addrspace-conversion.cl @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -emit-llvm -O0 -o - | FileCheck %s +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -emit-llvm -O0 -o - | FileCheck %s void bar(__generic volatile unsigned int* ptr) { Index: test/CodeGenOpenCLCXX/addrspace-derived-base.cl =================================================================== --- test/CodeGenOpenCLCXX/addrspace-derived-base.cl +++ test/CodeGenOpenCLCXX/addrspace-derived-base.cl @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -triple spir -cl-std=c++ -emit-llvm -O0 -o - | FileCheck %s +// RUN: %clang_cc1 %s -triple spir -cl-std=clc++ -emit-llvm -O0 -o - | FileCheck %s struct B { int mb; Index: test/CodeGenOpenCLCXX/addrspace-of-this.cl =================================================================== --- test/CodeGenOpenCLCXX/addrspace-of-this.cl +++ test/CodeGenOpenCLCXX/addrspace-of-this.cl @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -emit-llvm -pedantic -verify -O0 -o - -DDECL | FileCheck %s --check-prefixes="COMMON,EXPL" -// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -emit-llvm -pedantic -verify -O0 -o - -DDECL -DUSE_DEFLT | FileCheck %s --check-prefixes="COMMON,IMPL" -// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -emit-llvm -pedantic -verify -O0 -o - | FileCheck %s --check-prefixes="COMMON,IMPL" +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -emit-llvm -pedantic -verify -O0 -o - -DDECL | FileCheck %s --check-prefixes="COMMON,EXPL" +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -emit-llvm -pedantic -verify -O0 -o - -DDECL -DUSE_DEFLT | FileCheck %s --check-prefixes="COMMON,IMPL" +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -emit-llvm -pedantic -verify -O0 -o - | FileCheck %s --check-prefixes="COMMON,IMPL" // expected-no-diagnostics // Test that the 'this' pointer is in the __generic address space. Index: test/CodeGenOpenCLCXX/addrspace-operators.cl =================================================================== --- test/CodeGenOpenCLCXX/addrspace-operators.cl +++ test/CodeGenOpenCLCXX/addrspace-operators.cl @@ -1,4 +1,4 @@ -//RUN: %clang_cc1 %s -triple spir -cl-std=c++ -emit-llvm -O0 -o - | FileCheck %s +//RUN: %clang_cc1 %s -triple spir -cl-std=clc++ -emit-llvm -O0 -o - | FileCheck %s enum E { a, Index: test/CodeGenOpenCLCXX/addrspace-references.cl =================================================================== --- test/CodeGenOpenCLCXX/addrspace-references.cl +++ test/CodeGenOpenCLCXX/addrspace-references.cl @@ -1,4 +1,4 @@ -//RUN: %clang_cc1 %s -cl-std=c++ -triple spir -emit-llvm -o - | FileCheck %s +//RUN: %clang_cc1 %s -cl-std=clc++ -triple spir -emit-llvm -o - | FileCheck %s int bar(const unsigned int &i); // CHECK-LABEL: define spir_func void @_Z3foov() Index: test/CodeGenOpenCLCXX/addrspace-with-class.cl =================================================================== --- test/CodeGenOpenCLCXX/addrspace-with-class.cl +++ test/CodeGenOpenCLCXX/addrspace-with-class.cl @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -emit-llvm -O0 -o - | FileCheck %s -// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -emit-llvm -O0 -o - | FileCheck %s --check-prefix=CHECK-DEFINITIONS +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -emit-llvm -O0 -o - | FileCheck %s +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -emit-llvm -O0 -o - | FileCheck %s --check-prefix=CHECK-DEFINITIONS // This test ensures the proper address spaces and address space cast are used // for constructors, member functions and destructors. Index: test/CodeGenOpenCLCXX/atexit.cl =================================================================== --- test/CodeGenOpenCLCXX/atexit.cl +++ test/CodeGenOpenCLCXX/atexit.cl @@ -1,4 +1,4 @@ -//RUN: %clang_cc1 %s -triple spir -cl-std=c++ -emit-llvm -O0 -o - | FileCheck %s +//RUN: %clang_cc1 %s -triple spir -cl-std=clc++ -emit-llvm -O0 -o - | FileCheck %s struct S { ~S(){}; Index: test/CodeGenOpenCLCXX/global_init.cl =================================================================== --- test/CodeGenOpenCLCXX/global_init.cl +++ test/CodeGenOpenCLCXX/global_init.cl @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -triple spir -cl-std=c++ -emit-llvm -O0 -o - | FileCheck %s +// RUN: %clang_cc1 %s -triple spir -cl-std=clc++ -emit-llvm -O0 -o - | FileCheck %s struct S { S() {} Index: test/CodeGenOpenCLCXX/local_addrspace_init.cl =================================================================== --- test/CodeGenOpenCLCXX/local_addrspace_init.cl +++ test/CodeGenOpenCLCXX/local_addrspace_init.cl @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -triple spir -cl-std=c++ -emit-llvm -O0 -o - | FileCheck %s +// RUN: %clang_cc1 %s -triple spir -cl-std=clc++ -emit-llvm -O0 -o - | FileCheck %s // Test that we don't initialize local address space objects. //CHECK: @_ZZ4testE1i = internal addrspace(3) global i32 undef Index: test/CodeGenOpenCLCXX/method-overload-address-space.cl =================================================================== --- test/CodeGenOpenCLCXX/method-overload-address-space.cl +++ test/CodeGenOpenCLCXX/method-overload-address-space.cl @@ -1,4 +1,4 @@ -//RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -emit-llvm -O0 -o - | FileCheck %s +//RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -emit-llvm -O0 -o - | FileCheck %s struct C { void foo() __local; Index: test/CodeGenOpenCLCXX/template-address-spaces.cl =================================================================== --- test/CodeGenOpenCLCXX/template-address-spaces.cl +++ test/CodeGenOpenCLCXX/template-address-spaces.cl @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -cl-std=c++ %s -emit-llvm -o - -O0 -triple spir-unknown-unknown | FileCheck %s +// RUN: %clang_cc1 -cl-std=clc++ %s -emit-llvm -o - -O0 -triple spir-unknown-unknown | FileCheck %s template struct S{ Index: test/Driver/autocomplete.c =================================================================== --- test/Driver/autocomplete.c +++ test/Driver/autocomplete.c @@ -34,8 +34,8 @@ // RUN: %clang --autocomplete=-cl-std=,CL2 | FileCheck %s -check-prefix=CLSTD // CLSTD: CL2.0 // RUN: %clang --autocomplete=-cl-std= | FileCheck %s -check-prefix=CLSTDALL -// CLSTDALL: c++ -// CLSTDALL-NEXT: cl + +// CLSTDALL: cl // CLSTDALL-NEXT: CL // CLSTDALL-NEXT: cl1.1 // CLSTDALL-NEXT: CL1.1 @@ -43,6 +43,8 @@ // CLSTDALL-NEXT: CL1.2 // CLSTDALL-NEXT: cl2.0 // CLSTDALL-NEXT: CL2.0 +// CLSTDALL-NEXT: clc++ +// CLSTDALL-NEXT: CLC++ // RUN: %clang --autocomplete=-fno-sanitize-coverage=,f | FileCheck %s -check-prefix=FNOSANICOVER // FNOSANICOVER: func // RUN: %clang --autocomplete=-fno-sanitize-coverage= | FileCheck %s -check-prefix=FNOSANICOVERALL Index: test/Driver/opencl.cl =================================================================== --- test/Driver/opencl.cl +++ test/Driver/opencl.cl @@ -2,7 +2,7 @@ // RUN: %clang -S -### -cl-std=CL1.1 %s 2>&1 | FileCheck --check-prefix=CHECK-CL11 %s // RUN: %clang -S -### -cl-std=CL1.2 %s 2>&1 | FileCheck --check-prefix=CHECK-CL12 %s // RUN: %clang -S -### -cl-std=CL2.0 %s 2>&1 | FileCheck --check-prefix=CHECK-CL20 %s -// RUN: %clang -S -### -cl-std=c++ %s 2>&1 | FileCheck --check-prefix=CHECK-CLCPP %s +// RUN: %clang -S -### -cl-std=clc++ %s 2>&1 | FileCheck --check-prefix=CHECK-CLCPP %s // RUN: %clang -S -### -cl-opt-disable %s 2>&1 | FileCheck --check-prefix=CHECK-OPT-DISABLE %s // RUN: %clang -S -### -cl-strict-aliasing %s 2>&1 | FileCheck --check-prefix=CHECK-STRICT-ALIASING %s // RUN: %clang -S -### -cl-single-precision-constant %s 2>&1 | FileCheck --check-prefix=CHECK-SINGLE-PRECISION-CONST %s @@ -22,7 +22,7 @@ // CHECK-CL11: "-cc1" {{.*}} "-cl-std=CL1.1" // CHECK-CL12: "-cc1" {{.*}} "-cl-std=CL1.2" // CHECK-CL20: "-cc1" {{.*}} "-cl-std=CL2.0" -// CHECK-CLCPP: "-cc1" {{.*}} "-cl-std=c++" +// CHECK-CLCPP: "-cc1" {{.*}} "-cl-std=clc++" // CHECK-OPT-DISABLE: "-cc1" {{.*}} "-cl-opt-disable" // CHECK-STRICT-ALIASING: "-cc1" {{.*}} "-cl-strict-aliasing" // CHECK-SINGLE-PRECISION-CONST: "-cc1" {{.*}} "-cl-single-precision-constant" Index: test/Frontend/opencl.cl =================================================================== --- test/Frontend/opencl.cl +++ test/Frontend/opencl.cl @@ -2,7 +2,7 @@ // RUN: %clang_cc1 %s -verify -fsyntax-only -cl-std=CL1.1 -DSYNTAX // RUN: %clang_cc1 %s -verify -fsyntax-only -cl-std=CL1.2 -DSYNTAX // RUN: %clang_cc1 %s -verify -fsyntax-only -cl-std=CL2.0 -DSYNTAX -// RUN: %clang_cc1 %s -verify -fsyntax-only -cl-std=c++ -DSYNTAX +// RUN: %clang_cc1 %s -verify -fsyntax-only -cl-std=clc++ -DSYNTAX // RUN: %clang_cc1 %s -verify -fsyntax-only -fblocks -DBLOCKS -DSYNTAX // RUN: %clang_cc1 %s -verify -fsyntax-only -cl-std=CL1.1 -fblocks -DBLOCKS -DSYNTAX // RUN: %clang_cc1 %s -verify -fsyntax-only -cl-std=CL1.2 -fblocks -DBLOCKS -DSYNTAX Index: test/Frontend/stdlang.c =================================================================== --- test/Frontend/stdlang.c +++ test/Frontend/stdlang.c @@ -4,11 +4,12 @@ // RUN: %clang_cc1 -x cl -cl-std=cl1.1 -DOPENCL %s // RUN: %clang_cc1 -x cl -cl-std=cl1.2 -DOPENCL %s // RUN: %clang_cc1 -x cl -cl-std=cl2.0 -DOPENCL %s -// RUN: %clang_cc1 -x cl -cl-std=c++ -DOPENCL %s +// RUN: %clang_cc1 -x cl -cl-std=clc++ -DOPENCL %s // RUN: %clang_cc1 -x cl -cl-std=CL -DOPENCL %s // RUN: %clang_cc1 -x cl -cl-std=CL1.1 -DOPENCL %s // RUN: %clang_cc1 -x cl -cl-std=CL1.2 -DOPENCL %s // RUN: %clang_cc1 -x cl -cl-std=CL2.0 -DOPENCL %s +// RUN: %clang_cc1 -x cl -cl-std=CLC++ -DOPENCL %s // RUN: not %clang_cc1 -x cl -std=c99 -DOPENCL %s 2>&1 | FileCheck --check-prefix=CHECK-C99 %s // RUN: not %clang_cc1 -x cl -cl-std=invalid -DOPENCL %s 2>&1 | FileCheck --check-prefix=CHECK-INVALID %s // CHECK-C99: error: invalid argument '-std=c99' not allowed with 'OpenCL' Index: test/Headers/opencl-c-header.cl =================================================================== --- test/Headers/opencl-c-header.cl +++ test/Headers/opencl-c-header.cl @@ -1,7 +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=c++ | FileCheck %s --check-prefix=CHECK20 +// RUN: %clang_cc1 -O0 -triple spir-unknown-unknown -internal-isystem ../../lib/Headers -include opencl-c.h -emit-llvm -o - %s -verify -cl-std=clc++ | 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. Index: test/Parser/opencl-cxx-keywords.cl =================================================================== --- test/Parser/opencl-cxx-keywords.cl +++ test/Parser/opencl-cxx-keywords.cl @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -verify -fsyntax-only -// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -verify -fsyntax-only -fexceptions -fcxx-exceptions +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -verify -fsyntax-only +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -verify -fsyntax-only -fexceptions -fcxx-exceptions // This test checks that various C++ and OpenCL C keywords are not available // in OpenCL. Index: test/Parser/opencl-cxx-virtual.cl =================================================================== --- test/Parser/opencl-cxx-virtual.cl +++ test/Parser/opencl-cxx-virtual.cl @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -fsyntax-only -verify +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -fsyntax-only -verify // Test that virtual functions and abstract classes are rejected. class virtual_functions { Index: test/Preprocessor/predefined-macros.c =================================================================== --- test/Preprocessor/predefined-macros.c +++ test/Preprocessor/predefined-macros.c @@ -131,7 +131,7 @@ // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL20 // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-fast-relaxed-math \ // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-FRM -// RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=c++ \ +// RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=clc++ \ // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CLCPP10 // CHECK-CL10: #define CL_VERSION_1_0 100 // CHECK-CL10: #define CL_VERSION_1_1 110 Index: test/SemaOpenCL/address-spaces-conversions-cl2.0.cl =================================================================== --- test/SemaOpenCL/address-spaces-conversions-cl2.0.cl +++ test/SemaOpenCL/address-spaces-conversions-cl2.0.cl @@ -1,9 +1,9 @@ // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DCONSTANT -cl-std=CL2.0 // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGLOBAL -cl-std=CL2.0 // RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGENERIC -cl-std=CL2.0 -// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DCONSTANT -cl-std=c++ -// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGLOBAL -cl-std=c++ -// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGENERIC -cl-std=c++ +// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DCONSTANT -cl-std=clc++ +// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGLOBAL -cl-std=clc++ +// RUN: %clang_cc1 %s -ffake-address-space-map -verify -pedantic -fsyntax-only -DGENERIC -cl-std=clc++ /* OpenCLC v2.0 adds a set of restrictions for conversions between pointers to * different address spaces, mainly described in Sections 6.5.5 and 6.5.6. Index: test/SemaOpenCL/address-spaces.cl =================================================================== --- test/SemaOpenCL/address-spaces.cl +++ test/SemaOpenCL/address-spaces.cl @@ -1,6 +1,6 @@ // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only // RUN: %clang_cc1 %s -cl-std=CL2.0 -verify -pedantic -fsyntax-only -// RUN: %clang_cc1 %s -cl-std=c++ -verify -pedantic -fsyntax-only +// RUN: %clang_cc1 %s -cl-std=clc++ -verify -pedantic -fsyntax-only __constant int ci = 1; Index: test/SemaOpenCL/builtin.cl =================================================================== --- test/SemaOpenCL/builtin.cl +++ test/SemaOpenCL/builtin.cl @@ -1,5 +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++ +// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=clc++ // expected-no-diagnostics Index: test/SemaOpenCL/clk_event_t.cl =================================================================== --- test/SemaOpenCL/clk_event_t.cl +++ test/SemaOpenCL/clk_event_t.cl @@ -1,5 +1,5 @@ // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=c++ +// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=clc++ // Taken from opencl-c.h #define CLK_NULL_EVENT (__builtin_astype(((__SIZE_MAX__)), clk_event_t)) Index: test/SemaOpenCL/extension-version.cl =================================================================== --- test/SemaOpenCL/extension-version.cl +++ test/SemaOpenCL/extension-version.cl @@ -2,12 +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=c++ %s -verify -triple spir-unknown-unknown +// RUN: %clang_cc1 -x cl -cl-std=clc++ %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 -// RUN: %clang_cc1 -x cl -cl-std=c++ %s -verify -triple spir-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES +// RUN: %clang_cc1 -x cl -cl-std=clc++ %s -verify -triple spir-unknown-unknown -Wpedantic-core-features -DTEST_CORE_FEATURES #if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200) && !defined(TEST_CORE_FEATURES) // 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++ +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -verify -pedantic -fsyntax-only -cl-std=clc++ #ifdef _OPENCL_H_ // expected-no-diagnostics Index: test/SemaOpenCL/invalid-image.cl =================================================================== --- test/SemaOpenCL/invalid-image.cl +++ test/SemaOpenCL/invalid-image.cl @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -verify -cl-std=c++ %s +// RUN: %clang_cc1 -verify -cl-std=clc++ %s // RUN: %clang_cc1 -verify %s // RUN: %clang_cc1 -verify -D=ATTR_TEST -fms-compatibility %s Index: test/SemaOpenCL/invalid-pipes-cl2.0.cl =================================================================== --- test/SemaOpenCL/invalid-pipes-cl2.0.cl +++ test/SemaOpenCL/invalid-pipes-cl2.0.cl @@ -1,5 +1,5 @@ // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 -// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=c++ +// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=clc++ global pipe int gp; // expected-error {{type '__global read_only pipe int' can only be used as a function parameter in OpenCL}} global reserve_id_t rid; // expected-error {{the '__global reserve_id_t' type cannot be used to declare a program scope variable}} Index: test/SemaOpenCLCXX/address-space-deduction.cl =================================================================== --- test/SemaOpenCLCXX/address-space-deduction.cl +++ test/SemaOpenCLCXX/address-space-deduction.cl @@ -1,4 +1,4 @@ -//RUN: %clang_cc1 %s -cl-std=c++ -pedantic -ast-dump -verify | FileCheck %s +//RUN: %clang_cc1 %s -cl-std=clc++ -pedantic -ast-dump -verify | FileCheck %s //expected-no-diagnostics Index: test/SemaOpenCLCXX/address-space-of-this-class-scope.cl =================================================================== --- test/SemaOpenCLCXX/address-space-of-this-class-scope.cl +++ test/SemaOpenCLCXX/address-space-of-this-class-scope.cl @@ -1,4 +1,4 @@ -//RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -pedantic -verify +//RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -pedantic -verify struct C { auto fGlob() __global -> decltype(this); Index: test/SemaOpenCLCXX/address-space-of-this.cl =================================================================== --- test/SemaOpenCLCXX/address-space-of-this.cl +++ test/SemaOpenCLCXX/address-space-of-this.cl @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -pedantic -verify -fsyntax-only +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -pedantic -verify -fsyntax-only // expected-no-diagnostics // Extract from PR38614 Index: test/SemaOpenCLCXX/address-space-references.cl =================================================================== --- test/SemaOpenCLCXX/address-space-references.cl +++ test/SemaOpenCLCXX/address-space-references.cl @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -pedantic -verify -fsyntax-only +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -pedantic -verify -fsyntax-only __global const int& f(__global float &ref) { return ref; // expected-error{{reference of type 'const __global int &' cannot bind to a temporary object because of address space mismatch}} Index: test/SemaOpenCLCXX/address-space-templates.cl =================================================================== --- test/SemaOpenCLCXX/address-space-templates.cl +++ test/SemaOpenCLCXX/address-space-templates.cl @@ -1,4 +1,4 @@ -//RUN: %clang_cc1 %s -cl-std=c++ -pedantic -verify -fsyntax-only +//RUN: %clang_cc1 %s -cl-std=clc++ -pedantic -verify -fsyntax-only template struct S { Index: test/SemaOpenCLCXX/address_space_overloading.cl =================================================================== --- test/SemaOpenCLCXX/address_space_overloading.cl +++ test/SemaOpenCLCXX/address_space_overloading.cl @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=c++ +// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=clc++ // expected-no-diagnostics struct RetGlob { Index: test/SemaOpenCLCXX/kernel_invalid.cl =================================================================== --- test/SemaOpenCLCXX/kernel_invalid.cl +++ test/SemaOpenCLCXX/kernel_invalid.cl @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -cl-std=c++ -pedantic -verify -fsyntax-only +// RUN: %clang_cc1 %s -cl-std=clc++ -pedantic -verify -fsyntax-only struct C { kernel void m(); //expected-error{{kernel functions cannot be class members}} Index: test/SemaOpenCLCXX/method-overload-address-space.cl =================================================================== --- test/SemaOpenCLCXX/method-overload-address-space.cl +++ test/SemaOpenCLCXX/method-overload-address-space.cl @@ -1,4 +1,4 @@ -//RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -pedantic -verify +//RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -pedantic -verify struct C { void m1() __local __local; //expected-warning{{multiple identical address spaces specified for type}} Index: test/SemaOpenCLCXX/newdelete.cl =================================================================== --- test/SemaOpenCLCXX/newdelete.cl +++ test/SemaOpenCLCXX/newdelete.cl @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -pedantic -verify -fsyntax-only +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -pedantic -verify -fsyntax-only class A { public: Index: test/SemaOpenCLCXX/restricted.cl =================================================================== --- test/SemaOpenCLCXX/restricted.cl +++ test/SemaOpenCLCXX/restricted.cl @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -pedantic -verify -fsyntax-only +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -pedantic -verify -fsyntax-only // This test checks that various C/C++/OpenCL C constructs are not available in // C++ for OpenCL.