| 1 |
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 |
| 2 |
// REQUIRES: amdgpu-registered-target |
| 3 |
// RUN: %clang_cc1 -fsyntax-only -verify -std=gnu++11 -triple amdgcn -Wno-unused-value %s |
| 4 |
|
| 5 |
void foo() { |
| 6 |
int n = 100; |
| 7 |
__amdgpu_texture_t v = 0; // expected-error {{cannot initialize a variable of type '__amdgpu_texture_t' with an rvalue of type 'int'}} |
| 8 |
static_cast<__amdgpu_texture_t>(n); // expected-error {{static_cast from 'int' to '__amdgpu_texture_t' is not allowed}} |
| 9 |
reinterpret_cast<__amdgpu_texture_t>(n); // expected-error {{reinterpret_cast from 'int' to '__amdgpu_texture_t' is not allowed}} |
| 10 |
(void)(v + v); // expected-error {{invalid operands to binary expression ('__amdgpu_texture_t' and '__amdgpu_texture_t')}} |
| 11 |
int x(v); // expected-error {{cannot initialize a variable of type 'int' with an lvalue of type '__amdgpu_texture_t'}} |
| 12 |
__amdgpu_texture_t k; |
| 13 |
} |
| 14 |
|
| 15 |
template<class T> void bar(T); |
| 16 |
void use(__amdgpu_texture_t r) { bar(r); } |
| 17 |
struct S { __amdgpu_texture_t r; int a; }; |