21 lines · plain
1// RUN: %clang_cc1 -verify %s2// RUN: %clang_cc1 -verify -cl-std=CL2.0 %s3// RUN: %clang_cc1 -verify -cl-std=clc++1.0 %s4// RUN: %clang_cc1 -verify -x c -D NOCL %s5 6#ifndef NOCL7kernel void f(__attribute__((nosvm)) global int* a);8#if (__OPENCL_C_VERSION__ == 200)9// expected-warning@-2 {{'nosvm' attribute is deprecated and ignored in OpenCL C version 2.0}}10#elif (__OPENCL_CPP_VERSION__ == 100)11// expected-warning@-4 {{'nosvm' attribute is deprecated and ignored in C++ for OpenCL version 1.0}}12#else13// expected-error@-6 {{attribute 'nosvm' is supported in the OpenCL version 2.0 onwards}}14#endif15 16__attribute__((nosvm)) void g(void); // expected-warning {{'nosvm' attribute only applies to variables}}17 18#else19void f(__attribute__((nosvm)) int* a); // expected-warning {{'nosvm' attribute ignored}}20#endif21