diff --git a/ql/test/callgraph/Foo.qll b/ql/test/callgraph/Foo.qll new file mode 100644 index 00000000000..b289193b5e8 --- /dev/null +++ b/ql/test/callgraph/Foo.qll @@ -0,0 +1,15 @@ +import ql + +predicate foo() { none() } + +query predicate test() { foo() } + +class Foo extends AstNode { + predicate bar() { none() } + + predicate baz() { bar() } +} + +class Sub extends Foo { + override predicate baz() { super.baz() } +} diff --git a/ql/test/callgraph/callgraph.expected b/ql/test/callgraph/callgraph.expected new file mode 100644 index 00000000000..497b6e6591e --- /dev/null +++ b/ql/test/callgraph/callgraph.expected @@ -0,0 +1,3 @@ +| Foo.qll:5:26:5:30 | PredicateCall | Foo.qll:3:1:3:26 | foo | +| Foo.qll:10:21:10:25 | PredicateCall | Foo.qll:8:3:8:28 | ClassPredicate | +| Foo.qll:14:30:14:40 | MemberCall | Foo.qll:10:3:10:27 | ClassPredicate | diff --git a/ql/test/callgraph/callgraph.ql b/ql/test/callgraph/callgraph.ql new file mode 100644 index 00000000000..ef5aecf1bbc --- /dev/null +++ b/ql/test/callgraph/callgraph.ql @@ -0,0 +1,3 @@ +import ql + +query AstNode getTarget(Call call) { result = call.getTarget().getDeclaration() }