Support versioned=%d at the section level.
Test: nose2
Bug: https://github.com/android-ndk/ndk/issues/265
Change-Id: I4c22cb8069f41861613ecf01f7e1adbe1d3118a9
diff --git a/cc/test_gen_stub_libs.py b/cc/test_gen_stub_libs.py
index e9e7249..8683d31 100755
--- a/cc/test_gen_stub_libs.py
+++ b/cc/test_gen_stub_libs.py
@@ -407,6 +407,14 @@
woodly;
doodly; # var
} VERSION_2;
+
+ VERSION_4 { # versioned=9
+ wibble;
+ } VERSION_2;
+
+ VERSION_5 { # versioned=14
+ wobble;
+ } VERSION_4;
"""))
parser = gsl.SymbolFileParser(input_file)
versions = parser.parse()
@@ -420,6 +428,8 @@
int foo = 0;
void baz() {}
void qux() {}
+ void wibble() {}
+ void wobble() {}
""")
self.assertEqual(expected_src, src_file.getvalue())
@@ -432,6 +442,10 @@
global:
baz;
} VERSION_1;
+ VERSION_4 {
+ global:
+ wibble;
+ } VERSION_2;
""")
self.assertEqual(expected_version, version_file.getvalue())