Add tofix/ parser test files
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 13 Jul 2011 19:15:35 +0000 (15:15 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 13 Jul 2011 19:15:35 +0000 (15:15 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/metadata/ctf-test/readme.txt
formats/ctf/metadata/ctf-test/tofix/ctf-redefine-type.txt [new file with mode: 0644]
formats/ctf/metadata/ctf-test/tofix/ctf-typedef-ambiguity.txt [new file with mode: 0644]

index 8dbb13148823942cf48951aa381f94bb859d570e..5bcb830b6ccca7f96b8733a4ad7d00e14af3387f 100644 (file)
@@ -1,4 +1,7 @@
 These are the CTF metadata parser test. Those under succeed/ should successfully
 parse. Those under fail/ should provide an appropriate failure message.
 
+The tests under tofix/ do not follow the CTF specifications due to
+ambiguity in the LALR parser implementation. These are rarely used.
+
 Mathieu Desnoyers
diff --git a/formats/ctf/metadata/ctf-test/tofix/ctf-redefine-type.txt b/formats/ctf/metadata/ctf-test/tofix/ctf-redefine-type.txt
new file mode 100644 (file)
index 0000000..f7a03d3
--- /dev/null
@@ -0,0 +1,23 @@
+typealias integer { size = 8; align = 8; signed = false; } := uint8_t;
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+// Define newtype
+typealias uint32_t := newtype;
+
+trace {
+       // Hide newtype
+       typedef uint8_t newtype;
+    
+       major = 0;
+       minor = 1;
+       uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+       byte_order = le;
+       packet.header := struct {
+            uint8_t  field;
+       };
+};
+
+event {
+       name = string;
+       fields := struct { string str; };
+};
diff --git a/formats/ctf/metadata/ctf-test/tofix/ctf-typedef-ambiguity.txt b/formats/ctf/metadata/ctf-test/tofix/ctf-typedef-ambiguity.txt
new file mode 100644 (file)
index 0000000..a5dd3a7
--- /dev/null
@@ -0,0 +1,8 @@
+// Define unsigned long
+typealias integer { ... } := unsigned long;
+
+// Define unsigned long int
+typealias integer { ... } := unsigned long int;
+
+// Define int
+typedef unsigned long int;
This page took 0.034682 seconds and 4 git commands to generate.