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
14 lines
632 B
Plaintext
14 lines
632 B
Plaintext
// RUN: %clang_cc1 %s -triple spir-unknown-unknown -pedantic -verify -ast-dump | FileCheck %s
|
|
|
|
// expected-no-diagnostics
|
|
|
|
//CHECK:`-FunctionDecl {{.*}} bar 'void (__global int *__private)'
|
|
//CHECK: |-ParmVarDecl {{.*}} used gl '__global int *__private'
|
|
//CHECK: `-VarDecl {{.*}} gen '__generic int *__private' cinit
|
|
//CHECK: `-CXXAddrspaceCastExpr {{.*}} '__generic int *' addrspace_cast<__generic int *> <AddressSpaceConversion>
|
|
//CHECK: `-DeclRefExpr {{.*}} '__global int *__private' lvalue ParmVar {{.*}} 'gl' '__global int *__private'
|
|
|
|
void bar(global int *gl) {
|
|
int *gen = addrspace_cast<int *>(gl);
|
|
}
|