comparison rathaxes_add_a_test_to_reproduce_the_pointer_to_rathaxes_bug.patch @ 92:5eb746474f0f

Add a test for the pointer to Rathaxes type/variable bug
author Louis Opter <louis@lse.epita.fr>
date Fri, 19 Oct 2012 09:00:25 +0200
parents
children 4e7107e284de
comparison
equal deleted inserted replaced
91:9f06d7fb2542 92:5eb746474f0f
1 # HG changeset patch
2 # Parent 7eec45c5cc587ee8b1839b38e9d9ec652856c45a
3 rathaxes: add a test for the pointer to Rathaxes type bug
4
5
6 diff --git a/rathaxes/compiler/tests/CMakeLists.txt b/rathaxes/compiler/tests/CMakeLists.txt
7 --- a/rathaxes/compiler/tests/CMakeLists.txt
8 +++ b/rathaxes/compiler/tests/CMakeLists.txt
9 @@ -43,3 +43,5 @@
10
11 # Tests for the typing system (should not do anymore than parsing/checking typing)
12 ADD_SUBDIRECTORY(typing)
13 +
14 +ADD_SUBDIRECTORY(pointer_to_rathaxes_type)
15 diff --git a/rathaxes/compiler/tests/pointer_to_rathaxes_type/CMakeLists.txt b/rathaxes/compiler/tests/pointer_to_rathaxes_type/CMakeLists.txt
16 new file mode 100644
17 --- /dev/null
18 +++ b/rathaxes/compiler/tests/pointer_to_rathaxes_type/CMakeLists.txt
19 @@ -0,0 +1,3 @@
20 +ADD_RATHAXES_SOURCES(test_pointer_to_rathaxes_type pointer_to_rathaxes_type.rtx
21 + RTI pointer_to_rathaxes_type.rti
22 + BLT pointer_to_rathaxes_type.blt)
23 diff --git a/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.blt b/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.blt
24 new file mode 100644
25 --- /dev/null
26 +++ b/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.blt
27 @@ -0,0 +1,32 @@
28 +with Test
29 +{
30 + ${pointcut Test::code()};
31 +
32 + template type Test::Test()
33 + {
34 + chunk ::decl()
35 + {
36 + int;
37 + }
38 +
39 + map
40 + {
41 + }
42 + }
43 +
44 + template sequence Test::entry_point(Test::Test)
45 + {
46 + chunk code()
47 + {
48 + int
49 + main(void)
50 + {
51 + ${Test::Test} *p;
52 +
53 + ${pointcut ::IMPLEMENTATION(local.p)};
54 +
55 + return 0;
56 + }
57 + }
58 + }
59 +}
60 diff --git a/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.rti b/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.rti
61 new file mode 100644
62 --- /dev/null
63 +++ b/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.rti
64 @@ -0,0 +1,14 @@
65 +interface Test
66 +{
67 + provided pointcut code();
68 +
69 + provided type Test
70 + {
71 + chunk ::decl();
72 + }
73 +
74 + required sequence entry_point(Test::Test)
75 + {
76 + provided chunk code();
77 + }
78 +}
79 diff --git a/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.rtx b/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.rtx
80 new file mode 100644
81 --- /dev/null
82 +++ b/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.rtx
83 @@ -0,0 +1,10 @@
84 +device Test use Test
85 +{
86 + Test::entry_point(Test::Test t)
87 + {
88 + }
89 +}
90 +
91 +configuration
92 +{
93 +}