1 // RUN: %clang_cc1 -triple amdgcn---amdgiz -std=c++11 -fsyntax-only -verify %s
2 // expected-no-diagnostics
3 typedef __SIZE_TYPE__ size_t;
4 typedef __PTRDIFF_TYPE__ ptrdiff_t;
5 typedef __INTPTR_TYPE__ intptr_t;
6 typedef __UINTPTR_TYPE__ uintptr_t;
7 typedef __attribute__((address_space(1))) void *global_ptr_t;
8 typedef __attribute__((address_space(2))) void *constant_ptr_t;
9 typedef __attribute__((address_space(3))) void *local_ptr_t;
10 typedef __attribute__((address_space(5))) void *private_ptr_t;
11 
test()12 void test() {
13   static_assert(sizeof(size_t) == 8, "bad size");
14   static_assert(alignof(size_t) == 8, "bad alignment");
15   static_assert(sizeof(intptr_t) == 8, "bad size");
16   static_assert(alignof(intptr_t) == 8, "bad alignment");
17   static_assert(sizeof(uintptr_t) == 8, "bad size");
18   static_assert(alignof(uintptr_t) == 8, "bad alignment");
19   static_assert(sizeof(ptrdiff_t) == 8, "bad size");
20   static_assert(alignof(ptrdiff_t) == 8, "bad alignment");
21 
22   static_assert(sizeof(char) == 1, "bad size");
23   static_assert(alignof(char) == 1, "bad alignment");
24   static_assert(sizeof(short) == 2, "bad size");
25   static_assert(alignof(short) == 2, "bad alignment");
26   static_assert(sizeof(int) == 4, "bad size");
27   static_assert(alignof(int) == 4, "bad alignment");
28   static_assert(sizeof(long) == 8, "bad size");
29   static_assert(alignof(long) == 8, "bad alignment");
30   static_assert(sizeof(long long) == 8, "bad size");
31   static_assert(alignof(long long) == 8, "bad alignment");
32   static_assert(sizeof(float) == 4, "bad size");
33   static_assert(alignof(float) == 4, "bad alignment");
34   static_assert(sizeof(double) == 8, "bad size");
35   static_assert(alignof(double) == 8, "bad alignment");
36 
37   static_assert(sizeof(void*) == 8, "bad size");
38   static_assert(alignof(void*) == 8, "bad alignment");
39   static_assert(sizeof(global_ptr_t) == 8, "bad size");
40   static_assert(alignof(global_ptr_t) == 8, "bad alignment");
41   static_assert(sizeof(constant_ptr_t) == 8, "bad size");
42   static_assert(alignof(constant_ptr_t) == 8, "bad alignment");
43   static_assert(sizeof(local_ptr_t) == 4, "bad size");
44   static_assert(alignof(local_ptr_t) == 4, "bad alignment");
45   static_assert(sizeof(private_ptr_t) == 4, "bad size");
46   static_assert(alignof(private_ptr_t) == 4, "bad alignment");
47 }
48