Skip to content

Commit

Permalink
[OpenCL] Rename lang mode flag for C++ mode
Browse files Browse the repository at this point in the history
Rename lang mode flag to -cl-std=clc++/-cl-std=CLC++
or -std=clc++/-std=CLC++.

This aligns with OpenCL C conversion and removes ambiguity
with OpenCL C++. 

Differential Revision: https://reviews.llvm.org/D65102

llvm-svn: 367008
  • Loading branch information
Anastasia Stulova committed Jul 25, 2019
1 parent 2759545 commit 88ed70e
Show file tree
Hide file tree
Showing 53 changed files with 68 additions and 64 deletions.
2 changes: 1 addition & 1 deletion clang/docs/LanguageExtensions.rst
Expand Up @@ -1779,7 +1779,7 @@ invoked.
.. code-block:: console
clang -cl-std=c++ test.cl
clang -cl-std=clc++ test.cl
If there are any global objects to be initialized the final binary will
contain ``@_GLOBAL__sub_I_test.cl`` kernel to be enqueued.
Expand Down
4 changes: 2 additions & 2 deletions clang/docs/UsersManual.rst
Expand Up @@ -2776,7 +2776,7 @@ restrictions from OpenCL C v2.0 will inherently apply. All OpenCL C builtin type
and function libraries are supported and can be used in the new mode.

To enable the new mode pass the following command line option when compiling ``.cl``
file ``-cl-std=c++`` or ``-std=c++``.
file ``-cl-std=clc++``, ``-cl-std=CLC++``, ``-std=clc++`` or ``-std=CLC++``.

.. code-block:: c++

Expand All @@ -2794,7 +2794,7 @@ file ``-cl-std=c++`` or ``-std=c++``.

.. code-block:: console
clang -cl-std=c++ test.cl
clang -cl-std=clc++ test.cl
.. _target_features:

Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Driver/Options.td
Expand Up @@ -518,7 +518,7 @@ def cl_mad_enable : Flag<["-"], "cl-mad-enable">, Group<opencl_Group>, Flags<[CC
def cl_no_signed_zeros : Flag<["-"], "cl-no-signed-zeros">, Group<opencl_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<opencl_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<opencl_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<opencl_Group>, Flags<[CC1Option]>,
Expand Down
1 change: 1 addition & 0 deletions clang/include/clang/Frontend/LangStandards.def
Expand Up @@ -174,6 +174,7 @@ LANGSTANDARD_ALIAS_DEPR(opencl10, "CL")
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)",
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Frontend/CompilerInvocation.cpp
Expand Up @@ -2433,7 +2433,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
.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) {
Expand Down
4 changes: 2 additions & 2 deletions clang/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"
Expand Down
2 changes: 1 addition & 1 deletion clang/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.
Expand Down
2 changes: 1 addition & 1 deletion clang/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);
Expand Down
2 changes: 1 addition & 1 deletion clang/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

Expand Down
2 changes: 1 addition & 1 deletion clang/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.

Expand Down
2 changes: 1 addition & 1 deletion clang/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
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGenOpenCL/spir_version.cl
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion clang/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 {
Expand Down
@@ -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;
Expand Down
4 changes: 2 additions & 2 deletions clang/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 &
Expand Down
2 changes: 1 addition & 1 deletion clang/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:
Expand Down
2 changes: 1 addition & 1 deletion clang/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)
{
Expand Down
2 changes: 1 addition & 1 deletion clang/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;
Expand Down
6 changes: 3 additions & 3 deletions clang/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.
Expand Down
2 changes: 1 addition & 1 deletion clang/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,
Expand Down
2 changes: 1 addition & 1 deletion clang/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()
Expand Down
4 changes: 2 additions & 2 deletions clang/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.
Expand Down
2 changes: 1 addition & 1 deletion clang/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(){};
Expand Down
2 changes: 1 addition & 1 deletion clang/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() {}
Expand Down
2 changes: 1 addition & 1 deletion clang/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
Expand Down
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion clang/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 <typename T>
struct S{
Expand Down
6 changes: 4 additions & 2 deletions clang/test/Driver/autocomplete.c
Expand Up @@ -34,15 +34,17 @@
// 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
// CLSTDALL-NEXT: cl1.2
// 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
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Driver/opencl.cl
Expand Up @@ -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
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Frontend/opencl.cl
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion clang/test/Frontend/stdlang.c
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion clang/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.
Expand Down
4 changes: 2 additions & 2 deletions clang/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.
Expand Down
2 changes: 1 addition & 1 deletion clang/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 {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Preprocessor/predefined-macros.c
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions clang/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.
Expand Down
2 changes: 1 addition & 1 deletion clang/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;

Expand Down
2 changes: 1 addition & 1 deletion clang/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

Expand Down
2 changes: 1 addition & 1 deletion clang/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))
Expand Down
4 changes: 2 additions & 2 deletions clang/test/SemaOpenCL/extension-version.cl
Expand Up @@ -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
Expand Down

0 comments on commit 88ed70e

Please sign in to comment.