diff options
author | Alex AUVOLAT <alexis211@gmail.com> | 2013-10-29 17:42:34 +0100 |
---|---|---|
committer | Alex AUVOLAT <alexis211@gmail.com> | 2013-10-29 17:42:34 +0100 |
commit | 8f1093f0e00f9b1df7ce343a879303fd56a95d08 (patch) | |
tree | 6aaf0720c2093ba05cb81ba7f95b4e9808b3ecab /tests/typing/bad | |
download | LPC-Projet-8f1093f0e00f9b1df7ce343a879303fd56a95d08.tar.gz LPC-Projet-8f1093f0e00f9b1df7ce343a879303fd56a95d08.zip |
First commit.
Diffstat (limited to 'tests/typing/bad')
91 files changed, 244 insertions, 0 deletions
diff --git a/tests/typing/bad/testfile-ampersand-1.cpp b/tests/typing/bad/testfile-ampersand-1.cpp new file mode 100644 index 0000000..065b3c5 --- /dev/null +++ b/tests/typing/bad/testfile-ampersand-1.cpp @@ -0,0 +1 @@ +int main() { &1; } diff --git a/tests/typing/bad/testfile-ampersand-2.cpp b/tests/typing/bad/testfile-ampersand-2.cpp new file mode 100644 index 0000000..ceffc1b --- /dev/null +++ b/tests/typing/bad/testfile-ampersand-2.cpp @@ -0,0 +1,2 @@ + +int main() { int x; int y; &(x+y); } diff --git a/tests/typing/bad/testfile-ampersand-3.cpp b/tests/typing/bad/testfile-ampersand-3.cpp new file mode 100644 index 0000000..7228085 --- /dev/null +++ b/tests/typing/bad/testfile-ampersand-3.cpp @@ -0,0 +1,4 @@ + +void foo() {} +int main() { &(foo()); } + diff --git a/tests/typing/bad/testfile-arith-1.cpp b/tests/typing/bad/testfile-arith-1.cpp new file mode 100644 index 0000000..8dde0c2 --- /dev/null +++ b/tests/typing/bad/testfile-arith-1.cpp @@ -0,0 +1,2 @@ +class S { public: int a; }; +int main() { S s; s+s; } diff --git a/tests/typing/bad/testfile-arith-2.cpp b/tests/typing/bad/testfile-arith-2.cpp new file mode 100644 index 0000000..30c56d4 --- /dev/null +++ b/tests/typing/bad/testfile-arith-2.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { S s; s+1; } diff --git a/tests/typing/bad/testfile-arith-3.cpp b/tests/typing/bad/testfile-arith-3.cpp new file mode 100644 index 0000000..ec4f877 --- /dev/null +++ b/tests/typing/bad/testfile-arith-3.cpp @@ -0,0 +1,2 @@ + +int main() { char *p; p+p; } diff --git a/tests/typing/bad/testfile-arith-4.cpp b/tests/typing/bad/testfile-arith-4.cpp new file mode 100644 index 0000000..f9ca567 --- /dev/null +++ b/tests/typing/bad/testfile-arith-4.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { S s; char *p; p+s; } diff --git a/tests/typing/bad/testfile-arith-5.cpp b/tests/typing/bad/testfile-arith-5.cpp new file mode 100644 index 0000000..2637ffc --- /dev/null +++ b/tests/typing/bad/testfile-arith-5.cpp @@ -0,0 +1,2 @@ + +int main() { char *p; 1-p; } diff --git a/tests/typing/bad/testfile-arith-6.cpp b/tests/typing/bad/testfile-arith-6.cpp new file mode 100644 index 0000000..0ef23c4 --- /dev/null +++ b/tests/typing/bad/testfile-arith-6.cpp @@ -0,0 +1,3 @@ + +int main() { int *p; char *q; putchar(p-q); } + diff --git a/tests/typing/bad/testfile-arrow-1.cpp b/tests/typing/bad/testfile-arrow-1.cpp new file mode 100644 index 0000000..d756d00 --- /dev/null +++ b/tests/typing/bad/testfile-arrow-1.cpp @@ -0,0 +1 @@ +int main() { 1->a; } diff --git a/tests/typing/bad/testfile-arrow-2.cpp b/tests/typing/bad/testfile-arrow-2.cpp new file mode 100644 index 0000000..379a9d0 --- /dev/null +++ b/tests/typing/bad/testfile-arrow-2.cpp @@ -0,0 +1,2 @@ + +int main() { int x; x->a; } diff --git a/tests/typing/bad/testfile-arrow-3.cpp b/tests/typing/bad/testfile-arrow-3.cpp new file mode 100644 index 0000000..4691f12 --- /dev/null +++ b/tests/typing/bad/testfile-arrow-3.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { int x; x->a; } diff --git a/tests/typing/bad/testfile-arrow-4.cpp b/tests/typing/bad/testfile-arrow-4.cpp new file mode 100644 index 0000000..4691f12 --- /dev/null +++ b/tests/typing/bad/testfile-arrow-4.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { int x; x->a; } diff --git a/tests/typing/bad/testfile-arrow-5.cpp b/tests/typing/bad/testfile-arrow-5.cpp new file mode 100644 index 0000000..c41b56d --- /dev/null +++ b/tests/typing/bad/testfile-arrow-5.cpp @@ -0,0 +1,5 @@ + +class S { public: int a; }; +void foo() {} +int main() { (foo())->a; } + diff --git a/tests/typing/bad/testfile-assign-1.cpp b/tests/typing/bad/testfile-assign-1.cpp new file mode 100644 index 0000000..5da9fdd --- /dev/null +++ b/tests/typing/bad/testfile-assign-1.cpp @@ -0,0 +1 @@ +int main() { 1 = 2; } diff --git a/tests/typing/bad/testfile-assign-10.cpp b/tests/typing/bad/testfile-assign-10.cpp new file mode 100644 index 0000000..24bf51e --- /dev/null +++ b/tests/typing/bad/testfile-assign-10.cpp @@ -0,0 +1,2 @@ + +int main() { 1++; } diff --git a/tests/typing/bad/testfile-assign-11.cpp b/tests/typing/bad/testfile-assign-11.cpp new file mode 100644 index 0000000..15716dd --- /dev/null +++ b/tests/typing/bad/testfile-assign-11.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { S s; s++; } diff --git a/tests/typing/bad/testfile-assign-12.cpp b/tests/typing/bad/testfile-assign-12.cpp new file mode 100644 index 0000000..6440547 --- /dev/null +++ b/tests/typing/bad/testfile-assign-12.cpp @@ -0,0 +1,2 @@ + +int main() { int x; (x+1)++; } diff --git a/tests/typing/bad/testfile-assign-13.cpp b/tests/typing/bad/testfile-assign-13.cpp new file mode 100644 index 0000000..188b9c7 --- /dev/null +++ b/tests/typing/bad/testfile-assign-13.cpp @@ -0,0 +1,2 @@ + +int main() { 0--; } diff --git a/tests/typing/bad/testfile-assign-14.cpp b/tests/typing/bad/testfile-assign-14.cpp new file mode 100644 index 0000000..01a82c0 --- /dev/null +++ b/tests/typing/bad/testfile-assign-14.cpp @@ -0,0 +1,2 @@ + +int main() { 1--; } diff --git a/tests/typing/bad/testfile-assign-15.cpp b/tests/typing/bad/testfile-assign-15.cpp new file mode 100644 index 0000000..3c69dde --- /dev/null +++ b/tests/typing/bad/testfile-assign-15.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { S s; s--; } diff --git a/tests/typing/bad/testfile-assign-16.cpp b/tests/typing/bad/testfile-assign-16.cpp new file mode 100644 index 0000000..a7c70f0 --- /dev/null +++ b/tests/typing/bad/testfile-assign-16.cpp @@ -0,0 +1,2 @@ + +int main() { int x; (x+1)--; } diff --git a/tests/typing/bad/testfile-assign-17.cpp b/tests/typing/bad/testfile-assign-17.cpp new file mode 100644 index 0000000..e65c23e --- /dev/null +++ b/tests/typing/bad/testfile-assign-17.cpp @@ -0,0 +1,2 @@ + +int main() { ++0; } diff --git a/tests/typing/bad/testfile-assign-18.cpp b/tests/typing/bad/testfile-assign-18.cpp new file mode 100644 index 0000000..2294f48 --- /dev/null +++ b/tests/typing/bad/testfile-assign-18.cpp @@ -0,0 +1,2 @@ + +int main() { ++1; } diff --git a/tests/typing/bad/testfile-assign-19.cpp b/tests/typing/bad/testfile-assign-19.cpp new file mode 100644 index 0000000..ae01145 --- /dev/null +++ b/tests/typing/bad/testfile-assign-19.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { S s; ++s; } diff --git a/tests/typing/bad/testfile-assign-2.cpp b/tests/typing/bad/testfile-assign-2.cpp new file mode 100644 index 0000000..74969d8 --- /dev/null +++ b/tests/typing/bad/testfile-assign-2.cpp @@ -0,0 +1,2 @@ + +int main() { 0 = 1; } diff --git a/tests/typing/bad/testfile-assign-20.cpp b/tests/typing/bad/testfile-assign-20.cpp new file mode 100644 index 0000000..b60dafb --- /dev/null +++ b/tests/typing/bad/testfile-assign-20.cpp @@ -0,0 +1,2 @@ + +int main() { int x; ++(x+1); } diff --git a/tests/typing/bad/testfile-assign-21.cpp b/tests/typing/bad/testfile-assign-21.cpp new file mode 100644 index 0000000..0eeee1f --- /dev/null +++ b/tests/typing/bad/testfile-assign-21.cpp @@ -0,0 +1,2 @@ + +int main() { --0; } diff --git a/tests/typing/bad/testfile-assign-22.cpp b/tests/typing/bad/testfile-assign-22.cpp new file mode 100644 index 0000000..36b8226 --- /dev/null +++ b/tests/typing/bad/testfile-assign-22.cpp @@ -0,0 +1,2 @@ + +int main() { --1; } diff --git a/tests/typing/bad/testfile-assign-23.cpp b/tests/typing/bad/testfile-assign-23.cpp new file mode 100644 index 0000000..8a07de0 --- /dev/null +++ b/tests/typing/bad/testfile-assign-23.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { S s; --s; } diff --git a/tests/typing/bad/testfile-assign-24.cpp b/tests/typing/bad/testfile-assign-24.cpp new file mode 100644 index 0000000..4189d96 --- /dev/null +++ b/tests/typing/bad/testfile-assign-24.cpp @@ -0,0 +1,2 @@ + +int main() { int x; --(x+1); } diff --git a/tests/typing/bad/testfile-assign-25.cpp b/tests/typing/bad/testfile-assign-25.cpp new file mode 100644 index 0000000..7bb02d2 --- /dev/null +++ b/tests/typing/bad/testfile-assign-25.cpp @@ -0,0 +1,2 @@ + +int main() { int x; x = --x--; } diff --git a/tests/typing/bad/testfile-assign-26.cpp b/tests/typing/bad/testfile-assign-26.cpp new file mode 100644 index 0000000..7ce0ded --- /dev/null +++ b/tests/typing/bad/testfile-assign-26.cpp @@ -0,0 +1,4 @@ + +void foo() {} +int main() { ++(foo()); } + diff --git a/tests/typing/bad/testfile-assign-27.cpp b/tests/typing/bad/testfile-assign-27.cpp new file mode 100644 index 0000000..66e5295 --- /dev/null +++ b/tests/typing/bad/testfile-assign-27.cpp @@ -0,0 +1 @@ +int main() { int *p; -p; } diff --git a/tests/typing/bad/testfile-assign-28.cpp b/tests/typing/bad/testfile-assign-28.cpp new file mode 100644 index 0000000..3d20c1b --- /dev/null +++ b/tests/typing/bad/testfile-assign-28.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { S s; +s; } diff --git a/tests/typing/bad/testfile-assign-29.cpp b/tests/typing/bad/testfile-assign-29.cpp new file mode 100644 index 0000000..dc6e3e6 --- /dev/null +++ b/tests/typing/bad/testfile-assign-29.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { S s; -s; } diff --git a/tests/typing/bad/testfile-assign-3.cpp b/tests/typing/bad/testfile-assign-3.cpp new file mode 100644 index 0000000..4926a21 --- /dev/null +++ b/tests/typing/bad/testfile-assign-3.cpp @@ -0,0 +1,2 @@ + +int main() { int x; int y; (x+y) = 2; } diff --git a/tests/typing/bad/testfile-assign-30.cpp b/tests/typing/bad/testfile-assign-30.cpp new file mode 100644 index 0000000..1d650eb --- /dev/null +++ b/tests/typing/bad/testfile-assign-30.cpp @@ -0,0 +1,3 @@ + +void foo() {} +int main() { +(foo()); } diff --git a/tests/typing/bad/testfile-assign-31.cpp b/tests/typing/bad/testfile-assign-31.cpp new file mode 100644 index 0000000..b31ee49 --- /dev/null +++ b/tests/typing/bad/testfile-assign-31.cpp @@ -0,0 +1,4 @@ + +void foo() {} +int main() { -(foo()); } + diff --git a/tests/typing/bad/testfile-assign-4.cpp b/tests/typing/bad/testfile-assign-4.cpp new file mode 100644 index 0000000..c71cddc --- /dev/null +++ b/tests/typing/bad/testfile-assign-4.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { int x; S s; x = s; } diff --git a/tests/typing/bad/testfile-assign-5.cpp b/tests/typing/bad/testfile-assign-5.cpp new file mode 100644 index 0000000..6d42d60 --- /dev/null +++ b/tests/typing/bad/testfile-assign-5.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { S s; s = 0; } diff --git a/tests/typing/bad/testfile-assign-6.cpp b/tests/typing/bad/testfile-assign-6.cpp new file mode 100644 index 0000000..12c2f37 --- /dev/null +++ b/tests/typing/bad/testfile-assign-6.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { int x; S s; s = x; } diff --git a/tests/typing/bad/testfile-assign-7.cpp b/tests/typing/bad/testfile-assign-7.cpp new file mode 100644 index 0000000..2e12f3a --- /dev/null +++ b/tests/typing/bad/testfile-assign-7.cpp @@ -0,0 +1,4 @@ + +class S { public: int a; }; +class T { public: int b; }; +int main() { S s; T t; s = t; } diff --git a/tests/typing/bad/testfile-assign-8.cpp b/tests/typing/bad/testfile-assign-8.cpp new file mode 100644 index 0000000..1c104db --- /dev/null +++ b/tests/typing/bad/testfile-assign-8.cpp @@ -0,0 +1,4 @@ + +void foo() {} +int main() { int x; x = foo(); } + diff --git a/tests/typing/bad/testfile-assign-9.cpp b/tests/typing/bad/testfile-assign-9.cpp new file mode 100644 index 0000000..7cfcff7 --- /dev/null +++ b/tests/typing/bad/testfile-assign-9.cpp @@ -0,0 +1 @@ +int main() { 0++; } diff --git a/tests/typing/bad/testfile-bang-1.cpp b/tests/typing/bad/testfile-bang-1.cpp new file mode 100644 index 0000000..2c45d1c --- /dev/null +++ b/tests/typing/bad/testfile-bang-1.cpp @@ -0,0 +1,2 @@ +class S { public: int a; }; +int main() { S s; !s; } diff --git a/tests/typing/bad/testfile-bang-2.cpp b/tests/typing/bad/testfile-bang-2.cpp new file mode 100644 index 0000000..1cecc76 --- /dev/null +++ b/tests/typing/bad/testfile-bang-2.cpp @@ -0,0 +1,4 @@ + +void foo() {} +int main() { !(foo()); } + diff --git a/tests/typing/bad/testfile-call-1.cpp b/tests/typing/bad/testfile-call-1.cpp new file mode 100644 index 0000000..2de8346 --- /dev/null +++ b/tests/typing/bad/testfile-call-1.cpp @@ -0,0 +1,2 @@ +void f(int x) {} +int main() { f(); } diff --git a/tests/typing/bad/testfile-call-2.cpp b/tests/typing/bad/testfile-call-2.cpp new file mode 100644 index 0000000..ddf482c --- /dev/null +++ b/tests/typing/bad/testfile-call-2.cpp @@ -0,0 +1,5 @@ + +class S { public: int a; }; +void f(int x) {} +int main() { S s; f(s); } + diff --git a/tests/typing/bad/testfile-class-1.cpp b/tests/typing/bad/testfile-class-1.cpp new file mode 100644 index 0000000..cb39856 --- /dev/null +++ b/tests/typing/bad/testfile-class-1.cpp @@ -0,0 +1 @@ +class S { public: S a; }; diff --git a/tests/typing/bad/testfile-class-2.cpp b/tests/typing/bad/testfile-class-2.cpp new file mode 100644 index 0000000..27a630c --- /dev/null +++ b/tests/typing/bad/testfile-class-2.cpp @@ -0,0 +1,3 @@ + +class S { public: void v; }; + diff --git a/tests/typing/bad/testfile-comparison-1.cpp b/tests/typing/bad/testfile-comparison-1.cpp new file mode 100644 index 0000000..2466fe4 --- /dev/null +++ b/tests/typing/bad/testfile-comparison-1.cpp @@ -0,0 +1,2 @@ +class S { public: int a; }; +int main() { int x; S s; 1 < s; } diff --git a/tests/typing/bad/testfile-comparison-2.cpp b/tests/typing/bad/testfile-comparison-2.cpp new file mode 100644 index 0000000..fc24f6a --- /dev/null +++ b/tests/typing/bad/testfile-comparison-2.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { int x; S s; 1 != s; } diff --git a/tests/typing/bad/testfile-comparison-3.cpp b/tests/typing/bad/testfile-comparison-3.cpp new file mode 100644 index 0000000..bdbb44b --- /dev/null +++ b/tests/typing/bad/testfile-comparison-3.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { S s1; S s2; s1 < s2; } diff --git a/tests/typing/bad/testfile-comparison-4.cpp b/tests/typing/bad/testfile-comparison-4.cpp new file mode 100644 index 0000000..6d7a48f --- /dev/null +++ b/tests/typing/bad/testfile-comparison-4.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { S s1; S s2; s1 != s2; } diff --git a/tests/typing/bad/testfile-comparison-5.cpp b/tests/typing/bad/testfile-comparison-5.cpp new file mode 100644 index 0000000..61d826c --- /dev/null +++ b/tests/typing/bad/testfile-comparison-5.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { int x; S s; 1 == s; } diff --git a/tests/typing/bad/testfile-comparison-6.cpp b/tests/typing/bad/testfile-comparison-6.cpp new file mode 100644 index 0000000..f081f6a --- /dev/null +++ b/tests/typing/bad/testfile-comparison-6.cpp @@ -0,0 +1,4 @@ + +void foo() {} +int main() { 1 < foo(); } + diff --git a/tests/typing/bad/testfile-deref-1.cpp b/tests/typing/bad/testfile-deref-1.cpp new file mode 100644 index 0000000..7854300 --- /dev/null +++ b/tests/typing/bad/testfile-deref-1.cpp @@ -0,0 +1 @@ +int main() { *1; } diff --git a/tests/typing/bad/testfile-deref-2.cpp b/tests/typing/bad/testfile-deref-2.cpp new file mode 100644 index 0000000..d3a1318 --- /dev/null +++ b/tests/typing/bad/testfile-deref-2.cpp @@ -0,0 +1,2 @@ + +int main() { int x; *x; } diff --git a/tests/typing/bad/testfile-deref-3.cpp b/tests/typing/bad/testfile-deref-3.cpp new file mode 100644 index 0000000..622fa8b --- /dev/null +++ b/tests/typing/bad/testfile-deref-3.cpp @@ -0,0 +1,4 @@ + +void foo() {} +int main() { *(foo()); } + diff --git a/tests/typing/bad/testfile-field-1.cpp b/tests/typing/bad/testfile-field-1.cpp new file mode 100644 index 0000000..785c97d --- /dev/null +++ b/tests/typing/bad/testfile-field-1.cpp @@ -0,0 +1 @@ +int main() { 1.a; } diff --git a/tests/typing/bad/testfile-field-2.cpp b/tests/typing/bad/testfile-field-2.cpp new file mode 100644 index 0000000..e64aded --- /dev/null +++ b/tests/typing/bad/testfile-field-2.cpp @@ -0,0 +1,2 @@ + +int main() { int x; x.a; } diff --git a/tests/typing/bad/testfile-field-3.cpp b/tests/typing/bad/testfile-field-3.cpp new file mode 100644 index 0000000..382e124 --- /dev/null +++ b/tests/typing/bad/testfile-field-3.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { int x; x.a; } diff --git a/tests/typing/bad/testfile-field-4.cpp b/tests/typing/bad/testfile-field-4.cpp new file mode 100644 index 0000000..4a2cf19 --- /dev/null +++ b/tests/typing/bad/testfile-field-4.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { S *s; s.a; } diff --git a/tests/typing/bad/testfile-field-5.cpp b/tests/typing/bad/testfile-field-5.cpp new file mode 100644 index 0000000..382e124 --- /dev/null +++ b/tests/typing/bad/testfile-field-5.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { int x; x.a; } diff --git a/tests/typing/bad/testfile-field-6.cpp b/tests/typing/bad/testfile-field-6.cpp new file mode 100644 index 0000000..4a2cf19 --- /dev/null +++ b/tests/typing/bad/testfile-field-6.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; }; +int main() { S *s; s.a; } diff --git a/tests/typing/bad/testfile-field-7.cpp b/tests/typing/bad/testfile-field-7.cpp new file mode 100644 index 0000000..3ab70cb --- /dev/null +++ b/tests/typing/bad/testfile-field-7.cpp @@ -0,0 +1,5 @@ + +class S { public: int a; }; +void foo() {} +int main() { (foo()).a; } + diff --git a/tests/typing/bad/testfile-for-1.cpp b/tests/typing/bad/testfile-for-1.cpp new file mode 100644 index 0000000..bd1cf8e --- /dev/null +++ b/tests/typing/bad/testfile-for-1.cpp @@ -0,0 +1,2 @@ +void foo() {} +int main() { for( ; foo(); ); } diff --git a/tests/typing/bad/testfile-for-2.cpp b/tests/typing/bad/testfile-for-2.cpp new file mode 100644 index 0000000..91dae25 --- /dev/null +++ b/tests/typing/bad/testfile-for-2.cpp @@ -0,0 +1,4 @@ + +class S { public: int a; }; +int main() { S s; for( ; s; ); } + diff --git a/tests/typing/bad/testfile-global-1.cpp b/tests/typing/bad/testfile-global-1.cpp new file mode 100644 index 0000000..860c09d --- /dev/null +++ b/tests/typing/bad/testfile-global-1.cpp @@ -0,0 +1,3 @@ +void v; +int main() { } + diff --git a/tests/typing/bad/testfile-if-1.cpp b/tests/typing/bad/testfile-if-1.cpp new file mode 100644 index 0000000..2a96643 --- /dev/null +++ b/tests/typing/bad/testfile-if-1.cpp @@ -0,0 +1,2 @@ +void foo() {} +int main() { if(foo()); } diff --git a/tests/typing/bad/testfile-if-2.cpp b/tests/typing/bad/testfile-if-2.cpp new file mode 100644 index 0000000..fa8aa4d --- /dev/null +++ b/tests/typing/bad/testfile-if-2.cpp @@ -0,0 +1,4 @@ + +class S { public: int a; }; +int main() { S s; if(s); } + diff --git a/tests/typing/bad/testfile-local-1.cpp b/tests/typing/bad/testfile-local-1.cpp new file mode 100644 index 0000000..850e678 --- /dev/null +++ b/tests/typing/bad/testfile-local-1.cpp @@ -0,0 +1,2 @@ +int main() { void v; } + diff --git a/tests/typing/bad/testfile-redef-1.cpp b/tests/typing/bad/testfile-redef-1.cpp new file mode 100644 index 0000000..db8446b --- /dev/null +++ b/tests/typing/bad/testfile-redef-1.cpp @@ -0,0 +1,2 @@ +int main() {} +int main() {} diff --git a/tests/typing/bad/testfile-redef-2.cpp b/tests/typing/bad/testfile-redef-2.cpp new file mode 100644 index 0000000..4518185 --- /dev/null +++ b/tests/typing/bad/testfile-redef-2.cpp @@ -0,0 +1,4 @@ + +void f() {} +void f() {} +int main() {} diff --git a/tests/typing/bad/testfile-redef-3.cpp b/tests/typing/bad/testfile-redef-3.cpp new file mode 100644 index 0000000..5e5d141 --- /dev/null +++ b/tests/typing/bad/testfile-redef-3.cpp @@ -0,0 +1,4 @@ + +int f; +void f() {} +int main() {} diff --git a/tests/typing/bad/testfile-redef-4.cpp b/tests/typing/bad/testfile-redef-4.cpp new file mode 100644 index 0000000..fa82b3d --- /dev/null +++ b/tests/typing/bad/testfile-redef-4.cpp @@ -0,0 +1,4 @@ + +void f() {} +int f; +int main() {} diff --git a/tests/typing/bad/testfile-redef-5.cpp b/tests/typing/bad/testfile-redef-5.cpp new file mode 100644 index 0000000..503a592 --- /dev/null +++ b/tests/typing/bad/testfile-redef-5.cpp @@ -0,0 +1,2 @@ + +int main() { int x; int x; } diff --git a/tests/typing/bad/testfile-redef-6.cpp b/tests/typing/bad/testfile-redef-6.cpp new file mode 100644 index 0000000..ae81bdc --- /dev/null +++ b/tests/typing/bad/testfile-redef-6.cpp @@ -0,0 +1,3 @@ + +class S { public: int a; int a; }; +int main() {} diff --git a/tests/typing/bad/testfile-ref-1.cpp b/tests/typing/bad/testfile-ref-1.cpp new file mode 100644 index 0000000..34b913a --- /dev/null +++ b/tests/typing/bad/testfile-ref-1.cpp @@ -0,0 +1 @@ +int main() { int &x = 42; } diff --git a/tests/typing/bad/testfile-ref-2.cpp b/tests/typing/bad/testfile-ref-2.cpp new file mode 100644 index 0000000..4997202 --- /dev/null +++ b/tests/typing/bad/testfile-ref-2.cpp @@ -0,0 +1,3 @@ + +int main() { int x; int &y = &x; } + diff --git a/tests/typing/bad/testfile-return-1.cpp b/tests/typing/bad/testfile-return-1.cpp new file mode 100644 index 0000000..5eb3571 --- /dev/null +++ b/tests/typing/bad/testfile-return-1.cpp @@ -0,0 +1,3 @@ +class S { public: int a; }; +S f() { return 1; } +int main() { } diff --git a/tests/typing/bad/testfile-return-2.cpp b/tests/typing/bad/testfile-return-2.cpp new file mode 100644 index 0000000..b14902c --- /dev/null +++ b/tests/typing/bad/testfile-return-2.cpp @@ -0,0 +1,4 @@ + +class S { public: int a; }; +int f() { S s; return s; } +int main() { } diff --git a/tests/typing/bad/testfile-return-3.cpp b/tests/typing/bad/testfile-return-3.cpp new file mode 100644 index 0000000..f13c7a3 --- /dev/null +++ b/tests/typing/bad/testfile-return-3.cpp @@ -0,0 +1,4 @@ + +class S { public: int a; }; +int main() { S s; return s; } + diff --git a/tests/typing/bad/testfile-scope-1.cpp b/tests/typing/bad/testfile-scope-1.cpp new file mode 100644 index 0000000..cc6caa9 --- /dev/null +++ b/tests/typing/bad/testfile-scope-1.cpp @@ -0,0 +1 @@ +int main() { { int x; } x; } diff --git a/tests/typing/bad/testfile-scope-2.cpp b/tests/typing/bad/testfile-scope-2.cpp new file mode 100644 index 0000000..13135ba --- /dev/null +++ b/tests/typing/bad/testfile-scope-2.cpp @@ -0,0 +1,3 @@ + +int main() { int x; if(x) { int y; } else y; } + diff --git a/tests/typing/bad/testfile-undef_var-1.cpp b/tests/typing/bad/testfile-undef_var-1.cpp new file mode 100644 index 0000000..d6d1769 --- /dev/null +++ b/tests/typing/bad/testfile-undef_var-1.cpp @@ -0,0 +1 @@ +int main() { x; } diff --git a/tests/typing/bad/testfile-undef_var-2.cpp b/tests/typing/bad/testfile-undef_var-2.cpp new file mode 100644 index 0000000..03922a3 --- /dev/null +++ b/tests/typing/bad/testfile-undef_var-2.cpp @@ -0,0 +1,3 @@ + +int main() { int x; } +void n() { x; } diff --git a/tests/typing/bad/testfile-undef_var-3.cpp b/tests/typing/bad/testfile-undef_var-3.cpp new file mode 100644 index 0000000..9831eb2 --- /dev/null +++ b/tests/typing/bad/testfile-undef_var-3.cpp @@ -0,0 +1,4 @@ + +int main(int x) { } +void n() { x; } + diff --git a/tests/typing/bad/testfile-while-1.cpp b/tests/typing/bad/testfile-while-1.cpp new file mode 100644 index 0000000..1cadb41 --- /dev/null +++ b/tests/typing/bad/testfile-while-1.cpp @@ -0,0 +1,2 @@ +void foo() {} +int main() { while(foo()); } diff --git a/tests/typing/bad/testfile-while-2.cpp b/tests/typing/bad/testfile-while-2.cpp new file mode 100644 index 0000000..3814d87 --- /dev/null +++ b/tests/typing/bad/testfile-while-2.cpp @@ -0,0 +1,4 @@ + +class S { public: int a; }; +int main() { S s; while(s); } + |