Skip to content

Commit

Permalink
Add region interprocedural fixpoint error test
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Sep 25, 2023
1 parent 70f267b commit 16077e3
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/regression/09-regions/40-zstd-thread-pool-region.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// SKIP PARAM: --set ana.activated[+] region
// FIXPOINT
#include<stdlib.h>
#include<pthread.h>
#include<goblint.h>

typedef struct POOL_job_s {
void *opaque;
} POOL_job;

typedef struct POOL_ctx_s {
POOL_job *queue;
} POOL_ctx;

POOL_ctx* ctx_global;

POOL_ctx* POOL_create(size_t numThreads, size_t queueSize)
{
POOL_ctx* ctx_create;
ctx_create = (POOL_ctx*)malloc(sizeof(POOL_ctx));
ctx_create->queue = (POOL_job*)malloc(queueSize * sizeof(POOL_job));

int r; // rand
if (r)
ctx_global = ctx_create; // pretend escape
return ctx_create;
}

int main() {
while (1) {
POOL_ctx *ctx_main;
ctx_main = POOL_create(20, 10);
}
}

0 comments on commit 16077e3

Please sign in to comment.