brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · 42e87e5 Raw
120 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST12// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST23// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST34// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST45// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST56// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST67// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST78// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST89 10// RUN: cp %s %t11// RUN: %clang_cc1 -x c++ %s -std=c++11 -fsyntax-only -verify -DTEST912// RUN: not %clang_cc1 -x c++ %t -std=c++11 -fixit -DTEST913// RUN: %clang_cc1 -x c++ %t -std=c++11 -fsyntax-only -DTEST914 15// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST1016// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST1117// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST1218// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST1319// RUN: %clang_cc1 -fsyntax-only -verify %s -DTEST1420 21#if TEST122 23// expected-no-diagnostics24typedef int Int;25typedef char Char;26typedef Char* Carp;27 28Int main(Int argc, Carp argv[]) {29}30 31#elif TEST232 33// expected-no-diagnostics34typedef int Int;35typedef char Char;36typedef Char* Carp;37 38Int main(Int argc, Carp argv[], Char *env[]) {39}40 41#elif TEST342 43// expected-no-diagnostics44int main() {45}46 47#elif TEST448 49static int main() { // expected-error {{'main' is not allowed to be declared static}}50}51 52#elif TEST553 54inline int main() { // expected-error {{'main' is not allowed to be declared inline}}55}56 57#elif TEST658 59void  // expected-error {{'main' must return 'int'}}60main( // expected-error {{first parameter of 'main' (argument count) must be of type 'int'}}61     float a62) {63}64 65const int main(); // expected-error {{'main' must return 'int'}}66 67#elif TEST768 69// expected-no-diagnostics70int main(int argc, const char* const* argv) {71}72 73#elif TEST874 75template<typename T>76int main() { } // expected-error{{'main' cannot be a template}}77 78#elif TEST979 80constexpr int main() { } // expected-error{{'main' is not allowed to be declared constexpr}}81 82#elif TEST1083 84// PR1510085// expected-no-diagnostics86typedef char charT;87int main(int, const charT**) {}88 89#elif TEST1190 91// expected-no-diagnostics92typedef char charT;93int main(int, charT* const *) {}94 95#elif TEST1296 97// expected-no-diagnostics98typedef char charT;99int main(int, const charT* const *) {}100 101#elif TEST13102 103int main(void) {}104 105template <typename T>106int main(void); // expected-error{{'main' cannot be a template}}107 108#elif TEST14109 110template <typename T>111int main(void); // expected-error{{'main' cannot be a template}}112 113int main(void) {}114 115#else116 117#error Unknown test mode118 119#endif120