| 1 |
// Verify that we can parse a simple CUDA file with different attributes order. |
| 2 |
// RUN: %clang_cc1 "-triple" "nvptx-nvidia-cuda" -fsyntax-only -verify %s |
| 3 |
// expected-no-diagnostics |
| 4 |
#include "Inputs/cuda.h" |
| 5 |
|
| 6 |
struct alignas(16) float4 { |
| 7 |
float x, y, z, w; |
| 8 |
}; |
| 9 |
|
| 10 |
__attribute__((device)) float func() { |
| 11 |
__shared__ alignas(alignof(float4)) float As[4][4]; // Both combinations |
| 12 |
alignas(alignof(float4)) __shared__ float Bs[4][4]; // must be legal |
| 13 |
|
| 14 |
return As[0][0] + Bs[0][0]; |
| 15 |
} |