summaryrefslogtreecommitdiffstats
path: root/clang/bindings/python/tests
diff options
context:
space:
mode:
authorEli Bendersky <eliben@google.com>2014-08-05 22:27:50 +0000
committerEli Bendersky <eliben@google.com>2014-08-05 22:27:50 +0000
commitd28bc5e2f21053927fe35f1feab750c196af84c1 (patch)
treeb433edd14db5e4d3a1d401bef969d6d505583694 /clang/bindings/python/tests
parentb8141d55b9a2a5afce3a4eb602c805e5793b1f64 (diff)
downloadbcm5719-llvm-d28bc5e2f21053927fe35f1feab750c196af84c1.tar.gz
bcm5719-llvm-d28bc5e2f21053927fe35f1feab750c196af84c1.zip
Expose the name mangling C API to Python bindings.
llvm-svn: 214930
Diffstat (limited to 'clang/bindings/python/tests')
-rw-r--r--clang/bindings/python/tests/cindex/test_cursor.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/bindings/python/tests/cindex/test_cursor.py b/clang/bindings/python/tests/cindex/test_cursor.py
index 43150450224..d4ee9daa961 100644
--- a/clang/bindings/python/tests/cindex/test_cursor.py
+++ b/clang/bindings/python/tests/cindex/test_cursor.py
@@ -252,3 +252,17 @@ def test_referenced():
if c.kind == CursorKind.CALL_EXPR:
assert c.referenced.spelling == foo.spelling
break
+
+def test_mangled_name():
+ kInputForMangling = """\
+ int foo(int, int);
+ """
+ tu = get_tu(kInputForMangling, lang='cpp')
+ foo = get_cursor(tu, 'foo')
+
+ # Since libclang does not link in targets, we cannot pass a triple to it
+ # and force the target. To enable this test to pass on all platforms, accept
+ # all valid manglings.
+ # [c-index-test handles this by running the source through clang, emitting
+ # an AST file and running libclang on that AST file]
+ assert foo.mangled_name in ('_Z3fooii', '__Z3fooii', '?foo@@YAHHH')
OpenPOWER on IntegriCloud