Add a test for broken nested union clang parsing
authorBrenden Blanco <bblanco@plumgrid.com>
Mon, 2 May 2016 04:27:19 +0000 (21:27 -0700)
committerBrenden Blanco <bblanco@plumgrid.com>
Mon, 2 May 2016 04:27:19 +0000 (21:27 -0700)
tests/python/test_clang.py

index ae19519..214ffaa 100755 (executable)
@@ -320,5 +320,13 @@ BPF_TABLE("array", int, union emptyu, t3, 1);
         with self.assertRaises(Exception):
             b = BPF(text="""int failure(void *ctx) { if (); return 0; }""")
 
+    def test_nested_union(self):
+        text = """
+BPF_TABLE("hash", struct bpf_tunnel_key, int, t1, 1);
+"""
+        b = BPF(text=text)
+        t1 = b["t1"]
+        print(t1.Key().remote_ipv4)
+
 if __name__ == "__main__":
     main()