Skip to content

Commit

Permalink
Add runtime implementation for goblint.h (issue #814)
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Oct 4, 2022
1 parent 5d64374 commit d2408bf
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 2 deletions.
1 change: 1 addition & 0 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@
(share lib_stub_src)
(share lib_runtime_include)
(share lib_runtime_src)
(share lib_runtime)
(share conf))
)
3 changes: 3 additions & 0 deletions lib/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# override root goblint .gitignore
!goblint

*.a
*.so
14 changes: 14 additions & 0 deletions lib/goblint/runtime/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
; dune build lib/goblint/runtime/libgoblint.a
(copy_files
(mode (promote (until-clean)))
(files src/libgoblint.a))

(copy_files
(mode (promote (until-clean)))
(files src/dllgoblint.so))

(install
(section (site (goblint lib_runtime)))
(files
libgoblint.a
dllgoblint.so))
2 changes: 0 additions & 2 deletions lib/goblint/runtime/include/goblint.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ void __goblint_assume_join(/* pthread_t thread */); // undeclared argument to av

void __goblint_split_begin(int exp);
void __goblint_split_end(int exp);

// TODO: provide identity runtime stubs for actual linking
5 changes: 5 additions & 0 deletions lib/goblint/runtime/src/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(foreign_library
(archive_name goblint)
(language c)
(names goblint)
(include_dirs ../include))
30 changes: 30 additions & 0 deletions lib/goblint/runtime/src/goblint.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include "goblint.h"
#include <pthread.h>

// Empty implementations (instead of asserts) because annotating documentation promises no-op right now.

void __goblint_check(int exp) {

}

void __goblint_assume(int exp) {

}

void __goblint_assert(int exp) {

}


void __goblint_assume_join(pthread_t thread) {

}


void __goblint_split_begin(int exp) {

}

void __goblint_split_end(int exp) {

}

0 comments on commit d2408bf

Please sign in to comment.