1 | // RUN: %clang_cc1 -verify %s |
2 | // RUN: %clang_cc1 -verify -cl-std=CL2.0 -D CL20 %s |
3 | // RUN: %clang_cc1 -verify -x c -D NOCL %s |
4 | |
5 | #ifndef NOCL |
6 | kernel void f(__attribute__((nosvm)) global int* a); |
7 | #ifndef CL20 |
8 | // expected-error@-2 {{'nosvm' attribute requires OpenCL version 2.0}} |
9 | #else |
10 | // expected-warning@-4 {{'nosvm' attribute is deprecated and ignored in OpenCL version 2.0}} |
11 | #endif |
12 | |
13 | __attribute__((nosvm)) void g(); // expected-warning {{'nosvm' attribute only applies to variables}} |
14 | |
15 | #else |
16 | void f(__attribute__((nosvm)) int* a); // expected-warning {{'nosvm' attribute ignored}} |
17 | #endif |
18 | |