From d87d543922e4cd1b862dfd7e93c4123620c3e217 Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 19 Jul 2015 16:27:02 +0000 Subject: [PATCH] .autotest git-svn-id: svn://ultimatepp.org/upp/trunk@8704 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- autotest/CppParser/CppParser.upp | 6 +++++- autotest/CppParser/test27.in | 5 +++++ autotest/CppParser/test27.out | 8 ++++++++ autotest/CppParser/test28.in | 19 +++++++++++++++++++ autotest/CppParser/test28.out | 23 +++++++++++++++++++++++ 5 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 autotest/CppParser/test27.in create mode 100644 autotest/CppParser/test27.out create mode 100644 autotest/CppParser/test28.in create mode 100644 autotest/CppParser/test28.out diff --git a/autotest/CppParser/CppParser.upp b/autotest/CppParser/CppParser.upp index 58264c549..4cefb494e 100644 --- a/autotest/CppParser/CppParser.upp +++ b/autotest/CppParser/CppParser.upp @@ -57,7 +57,11 @@ file test25.inc, test25.out, test26.in, - test26.out; + test26.out, + test27.in, + test27.out, + test28.in, + test28.out; mainconfig "" = "", diff --git a/autotest/CppParser/test27.in b/autotest/CppParser/test27.in new file mode 100644 index 000000000..a9f005c52 --- /dev/null +++ b/autotest/CppParser/test27.in @@ -0,0 +1,5 @@ +struct Alfa { + unsigned x:5; + unsigned y:10; + String h; +}; \ No newline at end of file diff --git a/autotest/CppParser/test27.out b/autotest/CppParser/test27.out new file mode 100644 index 000000000..24f2a9399 --- /dev/null +++ b/autotest/CppParser/test27.out @@ -0,0 +1,8 @@ +Alfa { + STRUCT, name: Alfa, qitem: struct, qtype: Alfa, qptype: , natural: struct Alfa, line 1, using + INSTANCEVARIABLE, name: x, qitem: x, qtype: , qptype: , natural: unsigned x:5, line 2, using + INSTANCEVARIABLE, name: y, qitem: y, qtype: , qptype: , natural: unsigned y:10, line 3, using + INSTANCEVARIABLE, name: h, qitem: h, qtype: String, qptype: , natural: String h, line 4, using +} + { +} \ No newline at end of file diff --git a/autotest/CppParser/test28.in b/autotest/CppParser/test28.in new file mode 100644 index 000000000..9ced547e9 --- /dev/null +++ b/autotest/CppParser/test28.in @@ -0,0 +1,19 @@ +template +struct Vector { + struct Iterator { + template + V operator->(T); + }; + + Iterator begin(); +}; + +struct Point { x, y }; + +void Foo() { + Point x; + Vector v; + const auto& y = x; + auto vv = v; + for(auto i : v) { + for(const auto& ii : vv) { diff --git a/autotest/CppParser/test28.out b/autotest/CppParser/test28.out new file mode 100644 index 000000000..8d7b2dd38 --- /dev/null +++ b/autotest/CppParser/test28.out @@ -0,0 +1,23 @@ +Vector { + STRUCTTEMPLATE, name: Vector, qitem: struct, qtype: Vector, qptype: , natural: template struct Vector, line 1, using + INSTANCEFUNCTION, name: begin, qitem: begin(), qtype: Vector::Iterator, qptype: , natural: Iterator begin(), line 8, using +} +Vector::Iterator { + STRUCT, name: Iterator, qitem: struct, qtype: Vector::Iterator, qptype: , natural: struct Iterator, line 3, using + INSTANCEFUNCTIONTEMPLATE, name: operator->, qitem: operator->(T), qtype: V, qptype: 0, natural: template V operator->(T), line 4, using +} +Point { + STRUCT, name: Point, qitem: struct, qtype: Point, qptype: , natural: struct Point, line 11, using + INSTANCEVARIABLE, name: y, qitem: y, qtype: x, qptype: , natural: xy, line 11, using +} + { + FUNCTION, name: Foo, qitem: Foo(), qtype: , qptype: , natural: void Foo(), line 13, using +} + { +x Point, line: 14 +v Vector, line: 15 +y Point, line: 16 +vv Vector, line: 17 +i Point, line: 18 +ii Point, line: 19 +} \ No newline at end of file