1 // RUN: %clang_cc1 -fsyntax-only -fobjc-arc -fobjc-runtime-has-weak -verify %s
2 // expected-no-diagnostics
5 void test_is_pointer() {
6 static_assert(__is_pointer(T), "");
8 static_assert(__is_pointer(T __weak), "");
9 static_assert(__is_pointer(T __strong), "");
10 static_assert(__is_pointer(T __autoreleasing), "");
11 static_assert(__is_pointer(T __unsafe_unretained), "");
13 static_assert(__is_pointer(T __weak const), "");
14 static_assert(__is_pointer(T __strong const), "");
15 static_assert(__is_pointer(T __autoreleasing const), "");
16 static_assert(__is_pointer(T __unsafe_unretained const), "");
18 static_assert(__is_pointer(T __weak volatile), "");
19 static_assert(__is_pointer(T __strong volatile), "");
20 static_assert(__is_pointer(T __autoreleasing volatile), "");
21 static_assert(__is_pointer(T __unsafe_unretained volatile), "");
23 static_assert(__is_pointer(T __weak const volatile), "");
24 static_assert(__is_pointer(T __strong const volatile), "");
25 static_assert(__is_pointer(T __autoreleasing const volatile), "");
26 static_assert(__is_pointer(T __unsafe_unretained const volatile), "");
31 int main(int, char**) {
32 test_is_pointer<id>();
33 test_is_pointer<id const>();
34 test_is_pointer<id volatile>();
35 test_is_pointer<id const volatile>();
37 test_is_pointer<Foo*>();
38 test_is_pointer<Foo const*>();
39 test_is_pointer<Foo volatile*>();
40 test_is_pointer<Foo const volatile*>();
42 test_is_pointer<void*>();
43 test_is_pointer<void const*>();
44 test_is_pointer<void volatile*>();
45 test_is_pointer<void const volatile*>();