Skip to content

Commit c8d0384

Browse files
authored
add callgraph test
1 parent 068c57a commit c8d0384

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

ql/test/callgraph/Foo.qll

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import ql
2+
3+
predicate foo() { none() }
4+
5+
query predicate test() { foo() }
6+
7+
class Foo extends AstNode {
8+
predicate bar() { none() }
9+
10+
predicate baz() { bar() }
11+
}
12+
13+
class Sub extends Foo {
14+
override predicate baz() { super.baz() }
15+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
| Foo.qll:5:26:5:30 | PredicateCall | Foo.qll:3:1:3:26 | foo |
2+
| Foo.qll:10:21:10:25 | PredicateCall | Foo.qll:8:3:8:28 | ClassPredicate |
3+
| Foo.qll:14:30:14:40 | MemberCall | Foo.qll:10:3:10:27 | ClassPredicate |

ql/test/callgraph/callgraph.ql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import ql
2+
3+
query AstNode getTarget(Call call) { result = call.getTarget().getDeclaration() }

0 commit comments

Comments
 (0)