add test of buildins

This commit is contained in:
erik-krogh
2022-12-01 12:26:06 +01:00
parent 236e6db996
commit 0ca38faa4d
2 changed files with 25 additions and 0 deletions

View File

@@ -19,3 +19,18 @@ import SimpleMod
private module SecondImpl implements MkThing<MyImpl>::SubMod {
predicate bar() { none() }
}
class Node extends int {
Node() { this = [0 .. 10] }
}
predicate sccEdge(Node a, Node b) { a = b % 2 }
private module Scc = QlBuiltins::EquivalenceRelation<Node, sccEdge/2>;
private class TypeFlowScc = Scc::EquivalenceClass;
/** Holds if `n` is part of an SCC of size 2 or more represented by `scc`. */
predicate sccRepr(Node n, TypeFlowScc scc) { scc = Scc::getEquivalenceClass(n) }
predicate sccJoinStep(Node n, TypeFlowScc scc) { none() }

View File

@@ -8,6 +8,8 @@ getTarget
| Foo.qll:19:38:19:52 | MkThing | Foo.qll:9:16:9:22 | MkThing |
| Foo.qll:19:38:19:60 | TypeExpr | Foo.qll:10:20:10:25 | SubMod |
| Foo.qll:19:46:19:51 | TypeExpr | Foo.qll:5:16:5:21 | MyImpl |
| Foo.qll:31:29:31:31 | Scc | Foo.qll:29:16:29:18 | Scc |
| Foo.qll:34:52:34:54 | Scc | Foo.qll:29:16:29:18 | Scc |
getTargetType
| ClassSig.qll:3:23:3:28 | TypeExpr | file://:0:0:0:0 | string |
| ClassSig.qll:7:12:7:17 | TypeExpr | ClassSig.qll:1:17:1:22 | FooSig |
@@ -23,3 +25,11 @@ getTargetType
| Foo.qll:19:38:19:52 | MkThing | Foo.qll:9:16:9:22 | MkThing |
| Foo.qll:19:38:19:60 | TypeExpr | Foo.qll:10:20:10:25 | SubMod |
| Foo.qll:19:46:19:51 | TypeExpr | Foo.qll:5:16:5:21 | MyImpl |
| Foo.qll:23:20:23:22 | TypeExpr | file://:0:0:0:0 | int |
| Foo.qll:27:19:27:22 | TypeExpr | Foo.qll:23:7:23:10 | Node |
| Foo.qll:27:27:27:30 | TypeExpr | Foo.qll:23:7:23:10 | Node |
| Foo.qll:29:54:29:57 | TypeExpr | Foo.qll:23:7:23:10 | Node |
| Foo.qll:31:29:31:31 | Scc | Foo.qll:29:16:29:18 | Scc |
| Foo.qll:34:19:34:22 | TypeExpr | Foo.qll:23:7:23:10 | Node |
| Foo.qll:34:52:34:54 | Scc | Foo.qll:29:16:29:18 | Scc |
| Foo.qll:36:23:36:26 | TypeExpr | Foo.qll:23:7:23:10 | Node |