view clang/test/Driver/cxx_for_opencl.clcpp @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 79ff65ed7e25
children c4bab56944e8
line wrap: on
line source

// 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
}