blob: 93e8782bcde4e2bd4cc8e921530ed0f2cbd25fb2 [file] [log] [blame]
Daniel Dunbar8452ef02010-06-29 16:52:24 +00001// RUN: %clang_cc1 -E -std=c++0x %s -o - | FileCheck --check-prefix=CHECK-0X %s
2// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-0X %s
Alexis Huntaf4e28d2010-01-13 08:31:49 +00003
4#if __has_feature(cxx_lambdas)
Douglas Gregorc41d94e2011-01-26 15:36:03 +00005int has_lambdas();
Alexis Huntaf4e28d2010-01-13 08:31:49 +00006#else
7int no_lambdas();
8#endif
9
10// CHECK-0X: no_lambdas
11// CHECK-NO-0X: no_lambdas
12
13
14#if __has_feature(cxx_nullptr)
Alexis Hunt10e2f722010-01-13 08:58:42 +000015int has_nullptr();
Alexis Huntaf4e28d2010-01-13 08:31:49 +000016#else
17int no_nullptr();
18#endif
19
20// CHECK-0X: no_nullptr
21// CHECK-NO-0X: no_nullptr
22
23
Alexis Huntaf4e28d2010-01-13 08:31:49 +000024#if __has_feature(cxx_decltype)
Alexis Hunt10e2f722010-01-13 08:58:42 +000025int has_decltype();
Alexis Huntaf4e28d2010-01-13 08:31:49 +000026#else
27int no_decltype();
28#endif
29
Alexis Hunt10e2f722010-01-13 08:58:42 +000030// CHECK-0X: has_decltype
Alexis Huntaf4e28d2010-01-13 08:31:49 +000031// CHECK-NO-0X: no_decltype
32
33
34#if __has_feature(cxx_auto_type)
Douglas Gregorc41d94e2011-01-26 15:36:03 +000035int has_auto_type();
Alexis Huntaf4e28d2010-01-13 08:31:49 +000036#else
37int no_auto_type();
38#endif
39
Richard Smith7ee0d562011-02-20 12:13:05 +000040// CHECK-0X: has_auto_type
Alexis Huntaf4e28d2010-01-13 08:31:49 +000041// CHECK-NO-0X: no_auto_type
42
43
44#if __has_feature(cxx_attributes)
Douglas Gregorc41d94e2011-01-26 15:36:03 +000045int has_attributes();
Alexis Huntaf4e28d2010-01-13 08:31:49 +000046#else
47int no_attributes();
48#endif
49
Douglas Gregorc41d94e2011-01-26 15:36:03 +000050// CHECK-0X: has_attributes
Alexis Huntaf4e28d2010-01-13 08:31:49 +000051// CHECK-NO-0X: no_attributes
52
53
54#if __has_feature(cxx_static_assert)
Alexis Hunt10e2f722010-01-13 08:58:42 +000055int has_static_assert();
Alexis Huntaf4e28d2010-01-13 08:31:49 +000056#else
57int no_static_assert();
58#endif
59
Alexis Hunt10e2f722010-01-13 08:58:42 +000060// CHECK-0X: has_static_assert
Alexis Huntaf4e28d2010-01-13 08:31:49 +000061// CHECK-NO-0X: no_static_assert
62
Alexis Huntaf4e28d2010-01-13 08:31:49 +000063#if __has_feature(cxx_deleted_functions)
Douglas Gregorc41d94e2011-01-26 15:36:03 +000064int has_deleted_functions();
Alexis Huntaf4e28d2010-01-13 08:31:49 +000065#else
66int no_deleted_functions();
67#endif
68
Douglas Gregorc41d94e2011-01-26 15:36:03 +000069// CHECK-0X: has_deleted_functions
70// CHECK-NO-0X: no_deleted_functions
Alexis Huntaf4e28d2010-01-13 08:31:49 +000071
72
73#if __has_feature(cxx_rvalue_references)
Douglas Gregorc41d94e2011-01-26 15:36:03 +000074int has_rvalue_references();
Alexis Huntaf4e28d2010-01-13 08:31:49 +000075#else
76int no_rvalue_references();
77#endif
78
Douglas Gregorc41d94e2011-01-26 15:36:03 +000079// CHECK-0X: has_rvalue_references
80// CHECK-NO-0X: no_rvalue_references
Alexis Huntaf4e28d2010-01-13 08:31:49 +000081
82
83#if __has_feature(cxx_variadic_templates)
Douglas Gregorc41d94e2011-01-26 15:36:03 +000084int has_variadic_templates();
Alexis Huntaf4e28d2010-01-13 08:31:49 +000085#else
86int no_variadic_templates();
87#endif
88
Douglas Gregorc41d94e2011-01-26 15:36:03 +000089// CHECK-0X: has_variadic_templates
90// CHECK-NO-0X: no_variadic_templates
Sebastian Redla93bb5b2010-08-31 23:28:47 +000091
92
93#if __has_feature(cxx_inline_namespaces)
Douglas Gregorc41d94e2011-01-26 15:36:03 +000094int has_inline_namespaces();
Sebastian Redla93bb5b2010-08-31 23:28:47 +000095#else
96int no_inline_namespaces();
97#endif
98
Douglas Gregorc41d94e2011-01-26 15:36:03 +000099// CHECK-0X: has_inline_namespaces
100// CHECK-NO-0X: no_inline_namespaces
Douglas Gregor56d5f0a2011-01-26 21:25:54 +0000101
102#if __has_feature(cxx_reference_qualified_functions)
103int has_reference_qualified_functions();
104#else
105int no_reference_qualified_functions();
106#endif
107
108// CHECK-0X: has_reference_qualified_functions
109// CHECK-NO-0X: no_reference_qualified_functions
110
Douglas Gregor7115aee2011-02-05 20:35:30 +0000111#if __has_feature(cxx_default_function_template_args)
112int has_default_function_template_args();
113#else
114int no_default_function_template_args();
115#endif
116
117// CHECK-0X: has_default_function_template_args
118// CHECK-NO-0X: no_default_function_template_args
119
Sebastian Redlc17003c2011-03-15 21:17:12 +0000120#if __has_feature(cxx_noexcept)
121int has_noexcept();
122#else
123int no_noexcept();
124#endif
125
126// CHECK-0X: has_noexcept
127// CHECK-NO-0X: no_noexcept
128
Anders Carlsson69f1f932011-03-25 15:04:23 +0000129#if __has_feature(cxx_override_control)
130int has_override_control();
131#else
132int no_override_control();
133#endif
134
135// CHECK-0X: has_override_control
136// CHECK-NO-0X: no_override_control