brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · 2bd5791 Raw
59 lines · plain
1// RUN: %clang_cc1 -triple spirv64 -aux-triple x86_64-unknown-linux-gnu \2// RUN:   -fcuda-is-device -verify -fsyntax-only %s3 4#define __global__ __attribute__((global))5 6__attribute__((reqd_work_group_size(0x100000000, 1, 1))) // expected-error {{integer constant expression evaluates to value 4294967296 that cannot be represented in a 32-bit unsigned integer type}}7__global__ void TestTooBigArg1(void);8 9__attribute__((work_group_size_hint(0x100000000, 1, 1))) // expected-error {{integer constant expression evaluates to value 4294967296 that cannot be represented in a 32-bit unsigned integer type}}10__global__ void TestTooBigArg2(void);11 12template <int... Args>13__attribute__((reqd_work_group_size(Args))) // expected-error {{expression contains unexpanded parameter pack 'Args'}}14__global__ void TestTemplateVariadicArgs1(void) {}15 16template <int... Args>17__attribute__((work_group_size_hint(Args))) // expected-error {{expression contains unexpanded parameter pack 'Args'}}18__global__ void TestTemplateVariadicArgs2(void) {}19 20template <class a> // expected-note {{declared here}}21__attribute__((reqd_work_group_size(a, 1, 1))) // expected-error {{'a' does not refer to a value}}22__global__ void TestTemplateArgClass1(void) {}23 24template <class a> // expected-note {{declared here}}25__attribute__((work_group_size_hint(a, 1, 1))) // expected-error {{'a' does not refer to a value}}26__global__ void TestTemplateArgClass2(void) {}27 28constexpr int A = 512;29 30__attribute__((reqd_work_group_size(A, A, A)))31__global__ void TestConstIntArg1(void) {}32 33__attribute__((work_group_size_hint(A, A, A)))34__global__ void TestConstIntArg2(void) {}35 36int B = 512;37__attribute__((reqd_work_group_size(B, 1, 1))) // expected-error {{attribute requires parameter 0 to be an integer constant}}38__global__ void TestNonConstIntArg1(void) {}39 40__attribute__((work_group_size_hint(B, 1, 1))) // expected-error {{attribute requires parameter 0 to be an integer constant}}41__global__ void TestNonConstIntArg2(void) {}42 43constexpr int C = -512;44__attribute__((reqd_work_group_size(C, 1, 1))) // expected-error {{attribute requires a non-negative integral compile time constant expression}}45__global__ void TestNegativeConstIntArg1(void) {}46 47__attribute__((work_group_size_hint(C, 1, 1))) // expected-error {{attribute requires a non-negative integral compile time constant expression}}48__global__ void TestNegativeConstIntArg2(void) {}49 50 51__attribute__((reqd_work_group_size(A, 0, 1))) // expected-error {{attribute must be greater than 0}}52__global__ void TestZeroArg1(void) {}53 54__attribute__((work_group_size_hint(A, 0, 1))) // expected-error {{attribute must be greater than 0}}55__global__ void TestZeroArg2(void) {}56 57 58 59