Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / basic / basic.start / basic.start.init / p3.cpp
blob506232ebacc4ccbc4088ade651afc03be5b71924
1 // RUN: %clang_cc1 -verify %s -pedantic-errors
2 // RUN: %clang_cc1 -verify %s -pedantic-errors -DINLINE
3 // RUN: %clang_cc1 -verify %s -pedantic-errors -DSTATIC
4 // RUN: %clang_cc1 -verify %s -pedantic-errors -std=c++11 -DCONSTEXPR
5 // RUN: %clang_cc1 -verify %s -std=c++11 -DDELETED
7 #if INLINE
8 inline // expected-error {{'main' is not allowed to be declared inline}}
9 #elif STATIC
10 static // expected-error {{'main' is not allowed to be declared static}}
11 #elif CONSTEXPR
12 constexpr // expected-error {{'main' is not allowed to be declared constexpr}}
13 #endif
14 int main(int argc, char **argv)
15 #if DELETED
16 = delete; // expected-error {{'main' is not allowed to be deleted}}
17 #else
19 int (*pmain)(int, char**) = &main; // expected-error {{ISO C++ does not allow 'main' to be used by a program}}
21 if (argc)
22 main(0, 0); // expected-error {{ISO C++ does not allow 'main' to be used by a program}}
24 #endif