view rathaxes_add_a_test_to_reproduce_the_pointer_to_rathaxes_bug.patch @ 95:4e7107e284de

Check that direct assignment works too in the pointer to Rathaxes type regression test
author Louis Opter <louis@lse.epita.fr>
date Mon, 22 Oct 2012 02:02:22 +0200
parents 5eb746474f0f
children
line wrap: on
line source

# HG changeset patch
# Parent 7adecea6d0fdaad6bb4a97993ef3f7e6cb465b8e
rathaxes: add a test for the pointer to Rathaxes type bug

diff --git a/rathaxes/compiler/tests/CMakeLists.txt b/rathaxes/compiler/tests/CMakeLists.txt
--- a/rathaxes/compiler/tests/CMakeLists.txt
+++ b/rathaxes/compiler/tests/CMakeLists.txt
@@ -43,3 +43,5 @@
 
 # Tests for the typing system (should not do anymore than parsing/checking typing)
 ADD_SUBDIRECTORY(typing)
+
+ADD_SUBDIRECTORY(pointer_to_rathaxes_type)
diff --git a/rathaxes/compiler/tests/pointer_to_rathaxes_type/CMakeLists.txt b/rathaxes/compiler/tests/pointer_to_rathaxes_type/CMakeLists.txt
new file mode 100644
--- /dev/null
+++ b/rathaxes/compiler/tests/pointer_to_rathaxes_type/CMakeLists.txt
@@ -0,0 +1,3 @@
+ADD_RATHAXES_SOURCES(test_pointer_to_rathaxes_type pointer_to_rathaxes_type.rtx
+                     RTI pointer_to_rathaxes_type.rti
+                     BLT pointer_to_rathaxes_type.blt)
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
new file mode 100644
--- /dev/null
+++ b/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.blt
@@ -0,0 +1,33 @@
+with Test
+{
+    ${pointcut Test::code()};
+
+    template type   Test::Test()
+    {
+        chunk   ::decl()
+        {
+            int;
+        }
+
+        map
+        {
+        }
+    }
+
+    template sequence   Test::entry_point(Test::Test)
+    {
+        chunk   code()
+        {
+            int
+            main(void)
+            {
+                ${Test::Test} *p;
+                ${Test::Test} *assign = NULL;
+
+                ${pointcut ::IMPLEMENTATION(local.p)};
+
+                return 0;
+            }
+        }
+    }
+}
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
new file mode 100644
--- /dev/null
+++ b/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.rti
@@ -0,0 +1,14 @@
+interface Test
+{
+    provided pointcut   code();
+
+    provided type   Test
+    {
+        chunk   ::decl();
+    }
+
+    required sequence   entry_point(Test::Test)
+    {
+        provided chunk  code();
+    }
+}
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
new file mode 100644
--- /dev/null
+++ b/rathaxes/compiler/tests/pointer_to_rathaxes_type/pointer_to_rathaxes_type.rtx
@@ -0,0 +1,10 @@
+device Test use Test
+{
+    Test::entry_point(Test::Test t)
+    {
+    }
+}
+
+configuration
+{
+}