File tree 4 files changed +50
-0
lines changed
string-refinement-strchr1
string-refinement-strchr2
4 files changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include <assert.h>
2
+ #include <string.h>
3
+
4
+ int main ()
5
+ {
6
+ char test [] = "foo" ;
7
+
8
+ char * first_o = strchr (test , 'o' );
9
+ assert (* first_o == test [1 ]);
10
+ assert (* first_o == test [0 ]);
11
+ char * first_t = strchr (test , 't' );
12
+ assert (* first_t == test [1 ]);
13
+ assert (* first_t == test [0 ]);
14
+ return 0 ;
15
+ }
Original file line number Diff line number Diff line change
1
+ CORE broken-smt-backend
2
+ test.c
3
+ --refine-strings --max-nondet-string-length 10
4
+ ^EXIT=10$
5
+ ^SIGNAL=0$
6
+ ^\[main.assertion.\d+\] line \d+ assertion \*first_o == test\[1\]: SUCCESS$
7
+ ^\[main.assertion.\d+\] line \d+ assertion \*first_o == test\[0\]: FAILURE$
8
+ ^\[main.assertion.\d+\] line \d+ assertion \*first_t == test\[1\]: FAILURE$
9
+ ^\[main.assertion.\d+\] line \d+ assertion \*first_t == test\[0\]: FAILURE$
10
+ ^VERIFICATION FAILED$
11
+ --
12
+ ^warning: ignoring
Original file line number Diff line number Diff line change
1
+ #include <assert.h>
2
+ #include <string.h>
3
+
4
+ int main ()
5
+ {
6
+ int i ;
7
+ char * test = i ? "fo\0tis" : "notfoti" ;
8
+
9
+ char * first_o = strchr (test , 'o' );
10
+ assert (first_o != NULL );
11
+ assert (* first_o == test [0 ]);
12
+ return 0 ;
13
+ }
Original file line number Diff line number Diff line change
1
+ CORE broken-smt-backend
2
+ test.c
3
+ --refine-strings
4
+ ^EXIT=10$
5
+ ^SIGNAL=0$
6
+ ^\[main.assertion.\d+\] line \d+ assertion first_o != (NULL|\(\(void \*\)0\)): SUCCESS$
7
+ ^\[main.assertion.\d+\] line \d+ assertion \*first_o == test\[0\]: FAILURE$
8
+ ^VERIFICATION FAILED$
9
+ --
10
+ ^warning: ignoring
You can’t perform that action at this time.
0 commit comments