llvm/clang/test/Driver/cxx_for_opencl.clcpp
Anastasia Stulova d1c8a151df [OpenCL] Added distinct file extension for C++ for OpenCL.
Files compiled with C++ for OpenCL mode can now have a distinct
file extension - clcpp, then clang driver picks the compilation
mode automatically (-x clcpp) without the use of -cl-std=clc++.

Differential Revision: https://reviews.llvm.org/D96771
2021-03-24 13:07:04 +00:00

19 lines
552 B
Plaintext

// RUN: %clang %s -Xclang -verify -fsyntax-only
// RUN: %clang %s -cl-std=clc++ -Xclang -verify -fsyntax-only
// RUN: %clang %s -cl-std=cl2.0 -Xclang -verify -fsyntax-only
// RUN: %clang %s -### 2>&1 | FileCheck %s
// CHECK: "-x" "clcpp"
#ifdef __OPENCL_CPP_VERSION__
//expected-no-diagnostics
#endif
kernel void k(){
auto a = get_local_id(1);
#ifndef __OPENCL_CPP_VERSION__
//expected-error@-2{{OpenCL C version 2.0 does not support the 'auto' storage class specifier}}
//expected-warning@-3{{type specifier missing, defaults to 'int'}}
#endif
}