has_extension.c revision c1b5fa41f09512c74030b9a2a0d1564535e22a76
1// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-PED-NONE %s 2// RUN: %clang_cc1 -pedantic-errors -E %s -o - | FileCheck --check-prefix=CHECK-PED-ERR %s 3 4// CHECK-PED-NONE: no_dummy_extension 5#if !__has_extension(dummy_extension) 6int no_dummy_extension(); 7#endif 8 9// Arbitrary feature to test that has_extension is a superset of has_feature 10// CHECK-PED-NONE: attribute_overloadable 11#if __has_extension(attribute_overloadable) 12int attribute_overloadable(); 13#endif 14 15// CHECK-PED-NONE: has_c_static_assert 16// CHECK-PED-ERR: no_c_static_assert 17#if __has_extension(c_static_assert) 18int has_c_static_assert(); 19#else 20int no_c_static_assert(); 21#endif 22 23// CHECK-PED-NONE: has_c_generic_selections 24// CHECK-PED-ERR: no_c_generic_selections 25#if __has_extension(c_generic_selections) 26int has_c_generic_selections(); 27#else 28int no_c_generic_selections(); 29#endif 30 31