diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-01-02 22:31:57 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-01-02 22:31:57 +0000 |
commit | eedb5432c590793296544cc947cfe50544488a7d (patch) | |
tree | b222eb9297793bebca6bc982f37a819052033dfb /clang/bindings/python/tests/cindex/test_cursor.py | |
parent | 1654035a3b19b82a114c5fa25e663efc4e7c712f (diff) | |
download | bcm5719-llvm-eedb5432c590793296544cc947cfe50544488a7d.tar.gz bcm5719-llvm-eedb5432c590793296544cc947cfe50544488a7d.zip |
[python bindings] Expose cursor.referenced (clang_getCursorReferenced).
Patch by Matthew King!
llvm-svn: 171423
Diffstat (limited to 'clang/bindings/python/tests/cindex/test_cursor.py')
-rw-r--r-- | clang/bindings/python/tests/cindex/test_cursor.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/bindings/python/tests/cindex/test_cursor.py b/clang/bindings/python/tests/cindex/test_cursor.py index edb209b52b9..a27525cfe55 100644 --- a/clang/bindings/python/tests/cindex/test_cursor.py +++ b/clang/bindings/python/tests/cindex/test_cursor.py @@ -250,3 +250,12 @@ def test_get_arguments(): assert len(arguments) == 2 assert arguments[0].spelling == "i" assert arguments[1].spelling == "j" + +def test_referenced(): + tu = get_tu('void foo(); void bar() { foo(); }') + foo = get_cursor(tu, 'foo') + bar = get_cursor(tu, 'bar') + for c in bar.get_children(): + if c.kind == CursorKind.CALL_EXPR: + assert c.referenced.spelling == foo.spelling + break |