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 @@ -996,7 +996,7 @@ struct
996996 let atomic = Param. handle_atomic && LockDomain.MustLock. equal m (LockDomain.MustLock. of_var LibraryFunctions. verifier_atomic_var) in
997997 (* TODO: what about G_m globals in cpa that weren't actually written? *)
998998 CPA. fold (fun x v (st : BaseComponents (D).t ) ->
999- if is_protected_by ask m x then ( (* is_in_Gm *)
999+ if (atomic && is_global ask x && not ( VD. is_immediate_type x.vtype)) || is_protected_by ask m x then ( (* is_in_Gm *)
10001000 (* Only apply sides for values that were actually written to globals!
10011001 This excludes invariants inferred through guards. *)
10021002 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 () {
11+ g = 1 ;
12+ }
13+
14+ int main (void ) {
15+ pthread_t thread ;
16+ pthread_create (& thread , NULL , (void * )fun , NULL );
17+
18+ __VERIFIER_atomic_begin ();
19+ g = 1 ;
20+ __VERIFIER_atomic_end ();
21+
22+ g = 5 ;
23+ __goblint_check (g <= 1 ); //UNKNOWN!
24+
25+
26+ return 0 ;
27+ }
You can’t perform that action at this time.
0 commit comments