Files
llvm-project/clang/test/SemaCUDA/amdgpu-num-gpr-attr.cu
Matt Arsenault b9e9dc5e89 Workaround attribute ordering issue with kernel only attributes
Placing the attribute after the kernel keyword would incorrectly
reject the attribute, so use the smae workaround that other
kernel only attributes use.

Also add a FIXME because there are two different phrasings now
for the same error, althoug amdgpu_num_[sv]gpr uses a consistent one.

llvm-svn: 223490
2014-12-05 18:03:58 +00:00

15 lines
666 B
Plaintext

// RUN: %clang_cc1 -fsyntax-only -verify %s
#include "Inputs/cuda.h"
__attribute__((amdgpu_num_vgpr(64)))
__global__ void test_num_vgpr() { } // expected-error {{'amdgpu_num_vgpr' attribute only applies to kernel functions}}
__attribute__((amdgpu_num_sgpr(32)))
__global__ void test_num_sgpr() { } // expected-error {{'amdgpu_num_sgpr' attribute only applies to kernel functions}}
// fixme-expected-error@+3 {{'amdgpu_num_sgpr' attribute only applies to kernel functions}}
// expected-error@+2 {{'amdgpu_num_vgpr' attribute only applies to kernel functions}}
__attribute__((amdgpu_num_sgpr(32), amdgpu_num_vgpr(64)))
__global__ void test_num_vgpr_num_sgpr() { }