add callgraph test

This commit is contained in:
Erik Krogh Kristensen
2021-05-29 08:34:09 +00:00
committed by GitHub
parent 068c57acdd
commit c8d0384907
3 changed files with 21 additions and 0 deletions

15
ql/test/callgraph/Foo.qll Normal file
View File

@@ -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() }
}

View File

@@ -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 |

View File

@@ -0,0 +1,3 @@
import ql
query AstNode getTarget(Call call) { result = call.getTarget().getDeclaration() }