summaryrefslogtreecommitdiffstats
path: root/clang/bindings/python/tests
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2015-10-27 15:50:22 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2015-10-27 15:50:22 +0000
commit6ea75dbeb089bb398f611256320fc9a88d830f2f (patch)
tree8587a7755a8e4c08a4d13d8d8217d4dfe75527bc /clang/bindings/python/tests
parentc7cb88066990d9b794c208252e13ef48a56b2439 (diff)
downloadbcm5719-llvm-6ea75dbeb089bb398f611256320fc9a88d830f2f.tar.gz
bcm5719-llvm-6ea75dbeb089bb398f611256320fc9a88d830f2f.zip
Index: expose is_mutable_field
Expose isMutable via libClang and python bindings. Patch by Jonathan B Coe! llvm-svn: 251410
Diffstat (limited to 'clang/bindings/python/tests')
-rw-r--r--clang/bindings/python/tests/cindex/test_cursor.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/bindings/python/tests/cindex/test_cursor.py b/clang/bindings/python/tests/cindex/test_cursor.py
index 68fc8fa4aca..c5ea50516ad 100644
--- a/clang/bindings/python/tests/cindex/test_cursor.py
+++ b/clang/bindings/python/tests/cindex/test_cursor.py
@@ -112,6 +112,21 @@ def test_is_const_method():
assert foo.is_const_method()
assert not bar.is_const_method()
+def test_is_mutable_field():
+ """Ensure Cursor.is_mutable_field works."""
+ source = 'class X { int x_; mutable int y_; };'
+ tu = get_tu(source, lang='cpp')
+
+ cls = get_cursor(tu, 'X')
+ x_ = get_cursor(tu, 'x_')
+ y_ = get_cursor(tu, 'y_')
+ assert cls is not None
+ assert x_ is not None
+ assert y_ is not None
+
+ assert not x_.is_mutable_field()
+ assert y_.is_mutable_field()
+
def test_is_static_method():
"""Ensure Cursor.is_static_method works."""
OpenPOWER on IntegriCloud