File tree Expand file tree Collapse file tree
tests/regression/13-privatized Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -980,7 +980,7 @@ struct
980980 let atomic = Param. handle_atomic && LockDomain.MustLock. equal m (LockDomain.MustLock. of_var LibraryFunctions. verifier_atomic_var) in
981981 (* TODO: what about G_m globals in cpa that weren't actually written? *)
982982 CPA. fold (fun x v (st : BaseComponents (D).t ) ->
983- if is_protected_by ask m x then ( (* is_in_Gm *)
983+ if (atomic && is_global ask x && not ( VD. is_immediate_type x.vtype)) || is_protected_by ask m x then ( (* is_in_Gm *)
984984 (* Only apply sides for values that were actually written to globals!
985985 This excludes invariants inferred through guards. *)
986986 begin match D. precise_side x v st.priv with
Original file line number Diff line number Diff line change 1+ // PARAM: --disable warn.race --enable ana.sv-comp.functions --set ana.path_sens[+] threadflag --set lib.activated[+] sv-comp --set ana.base.privatization protection-atomic
2+ #include <pthread.h>
3+ #include <stdlib.h>
4+ #include <goblint.h>
5+ extern void __VERIFIER_atomic_begin ();
6+ extern void __VERIFIER_atomic_end ();
7+
8+ int g ;
9+
10+ void * fun (void * arg ) {
11+ g = 1 ;
12+ return NULL ;
13+ }
14+
15+ int main (void ) {
16+ pthread_t thread ;
17+ pthread_create (& thread , NULL , fun , NULL );
18+
19+ __VERIFIER_atomic_begin ();
20+ g = 1 ;
21+ __VERIFIER_atomic_end ();
22+
23+ g = 5 ;
24+ __goblint_check (g <= 1 ); //UNKNOWN!
25+
26+
27+ return 0 ;
28+ }
You can’t perform that action at this time.
0 commit comments