update pet to version 0.11.6
[ppn.git] / tests / scalar.cc
blobfdf2c6fd31fd9e08775fcb7f1aa9ad3aaaaa2455
1 #include <assert.h>
2 #include "testlib.h"
4 using pdg::PDG;
6 int main(int argc, char *argv[])
8 isl_ctx *ctx = isl_ctx_alloc();
9 PDG *pdg = get_pdg(ctx, "testscalar");
10 int n_access = 0;
11 pdg::access *access = NULL;
13 assert(pdg->nodes.size() == 1);
14 for (int i = 0; i < pdg->nodes[0]->statement->accesses.size(); ++i) {
15 if (!pdg->nodes[0]->statement->accesses[i]->array)
16 continue;
17 n_access++;
18 access = pdg->nodes[0]->statement->accesses[i];
20 assert(n_access == 1);
21 assert(access->type == pdg::access::write);
22 assert(access->map->input() == 0);
23 assert(access->map->output() == 0);
25 pdg->free();
26 delete pdg;
27 isl_ctx_free(ctx);
29 return 0;