xref: /llvm-project/clang/test/Driver/cxx_for_opencl.clcpp (revision 2cb2cd242ca08d0bbd2a51a41f1317442e5414fc)
1// RUN: %clang %s -Xclang -verify -fsyntax-only
2// RUN: %clang %s -cl-std=clc++ -Xclang -verify -fsyntax-only
3// RUN: %clang %s -cl-std=cl2.0 -Xclang -verify -fsyntax-only
4// RUN: %clang %s -### 2>&1 | FileCheck %s
5
6// CHECK: "-x" "clcpp"
7
8#ifdef __OPENCL_CPP_VERSION__
9//expected-no-diagnostics
10#endif
11
12kernel void k(){
13  auto a = get_local_id(1);
14#ifndef __OPENCL_CPP_VERSION__
15//expected-error@-2{{OpenCL C version 2.0 does not support the 'auto' storage class specifier}}
16//expected-error@-3{{type specifier missing, defaults to 'int'}}
17#endif
18}
19