summaryrefslogtreecommitdiff
path: root/clang/test/CXX/basic/basic.start/basic.start.main
diff options
context:
space:
mode:
authorCarlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au>2012-10-15 17:10:06 +1100
committerCarlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au>2012-10-15 17:10:06 +1100
commitbe1de4be954c80875ad4108e0a33e8e131b2f2c0 (patch)
tree1fbbecf276bf7c7bdcbb4dd446099d6d90eaa516 /clang/test/CXX/basic/basic.start/basic.start.main
parentc4626a62754862d20b41e8a46a3574264ea80e6d (diff)
parentf1bd2e48c5324d3f7cda4090c87f8a5b6f463ce2 (diff)
Merge branch 'master' of ssh://bitbucket.org/czan/honours
Diffstat (limited to 'clang/test/CXX/basic/basic.start/basic.start.main')
-rw-r--r--clang/test/CXX/basic/basic.start/basic.start.main/p2a.cpp8
-rw-r--r--clang/test/CXX/basic/basic.start/basic.start.main/p2b.cpp8
-rw-r--r--clang/test/CXX/basic/basic.start/basic.start.main/p2c.cpp4
-rw-r--r--clang/test/CXX/basic/basic.start/basic.start.main/p2d.cpp4
-rw-r--r--clang/test/CXX/basic/basic.start/basic.start.main/p2e.cpp4
-rw-r--r--clang/test/CXX/basic/basic.start/basic.start.main/p2f.cpp7
-rw-r--r--clang/test/CXX/basic/basic.start/basic.start.main/p2g.cpp4
-rw-r--r--clang/test/CXX/basic/basic.start/basic.start.main/p2h.cpp5
-rw-r--r--clang/test/CXX/basic/basic.start/basic.start.main/p2i.cpp6
9 files changed, 50 insertions, 0 deletions
diff --git a/clang/test/CXX/basic/basic.start/basic.start.main/p2a.cpp b/clang/test/CXX/basic/basic.start/basic.start.main/p2a.cpp
new file mode 100644
index 0000000..b8dfbe7
--- /dev/null
+++ b/clang/test/CXX/basic/basic.start/basic.start.main/p2a.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+typedef int Int;
+typedef char Char;
+typedef Char* Carp;
+
+Int main(Int argc, Carp argv[]) {
+}
diff --git a/clang/test/CXX/basic/basic.start/basic.start.main/p2b.cpp b/clang/test/CXX/basic/basic.start/basic.start.main/p2b.cpp
new file mode 100644
index 0000000..785382c
--- /dev/null
+++ b/clang/test/CXX/basic/basic.start/basic.start.main/p2b.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+typedef int Int;
+typedef char Char;
+typedef Char* Carp;
+
+Int main(Int argc, Carp argv[], Char *env[]) {
+}
diff --git a/clang/test/CXX/basic/basic.start/basic.start.main/p2c.cpp b/clang/test/CXX/basic/basic.start/basic.start.main/p2c.cpp
new file mode 100644
index 0000000..81b08b9
--- /dev/null
+++ b/clang/test/CXX/basic/basic.start/basic.start.main/p2c.cpp
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+int main() {
+}
diff --git a/clang/test/CXX/basic/basic.start/basic.start.main/p2d.cpp b/clang/test/CXX/basic/basic.start/basic.start.main/p2d.cpp
new file mode 100644
index 0000000..bcdbdb2
--- /dev/null
+++ b/clang/test/CXX/basic/basic.start/basic.start.main/p2d.cpp
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+static int main() { // expected-error {{'main' is not allowed to be declared static}}
+}
diff --git a/clang/test/CXX/basic/basic.start/basic.start.main/p2e.cpp b/clang/test/CXX/basic/basic.start/basic.start.main/p2e.cpp
new file mode 100644
index 0000000..954fdbd
--- /dev/null
+++ b/clang/test/CXX/basic/basic.start/basic.start.main/p2e.cpp
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+inline int main() { // expected-error {{'main' is not allowed to be declared inline}}
+}
diff --git a/clang/test/CXX/basic/basic.start/basic.start.main/p2f.cpp b/clang/test/CXX/basic/basic.start/basic.start.main/p2f.cpp
new file mode 100644
index 0000000..ea5a752
--- /dev/null
+++ b/clang/test/CXX/basic/basic.start/basic.start.main/p2f.cpp
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+void // expected-error {{'main' must return 'int'}}
+main( // expected-error {{first parameter of 'main' (argument count) must be of type 'int'}}
+ float a
+) {
+}
diff --git a/clang/test/CXX/basic/basic.start/basic.start.main/p2g.cpp b/clang/test/CXX/basic/basic.start/basic.start.main/p2g.cpp
new file mode 100644
index 0000000..e3209fd
--- /dev/null
+++ b/clang/test/CXX/basic/basic.start/basic.start.main/p2g.cpp
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+int main(int argc, const char* const* argv) {
+}
diff --git a/clang/test/CXX/basic/basic.start/basic.start.main/p2h.cpp b/clang/test/CXX/basic/basic.start/basic.start.main/p2h.cpp
new file mode 100644
index 0000000..abf8faa
--- /dev/null
+++ b/clang/test/CXX/basic/basic.start/basic.start.main/p2h.cpp
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+template<typename T>
+int main() { } // expected-error{{'main' cannot be a template}}
+
diff --git a/clang/test/CXX/basic/basic.start/basic.start.main/p2i.cpp b/clang/test/CXX/basic/basic.start/basic.start.main/p2i.cpp
new file mode 100644
index 0000000..db8da3c
--- /dev/null
+++ b/clang/test/CXX/basic/basic.start/basic.start.main/p2i.cpp
@@ -0,0 +1,6 @@
+// RUN: cp %s %t
+// RUN: %clang_cc1 -x c++ %s -std=c++11 -fsyntax-only -verify
+// RUN: not %clang_cc1 -x c++ %t -std=c++11 -fixit
+// RUN: %clang_cc1 -x c++ %t -std=c++11 -fsyntax-only
+
+constexpr int main() { } // expected-error{{'main' is not allowed to be declared constexpr}}