Skip to content

Commit 5ca420b

Browse files
committed
Ensure labels (even __CPROVER_ASYNC_*) are unique per function
An upcoming change will enforce per-function unique labels, as mandated by the C standard. We were sometimes sloppy about this with __CPROVER_ASYNC_* pseudo-labels as they don't actually indicate jump targets.
1 parent d42839d commit 5ca420b

File tree

8 files changed

+17
-17
lines changed

8 files changed

+17
-17
lines changed

regression/cbmc-concurrency/atomic_section_sc3/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ unsigned dec() {
8585

8686
int main(){
8787
__CPROVER_ASYNC_1: inc();
88-
__CPROVER_ASYNC_1: dec();
89-
__CPROVER_ASYNC_1: dec();
88+
__CPROVER_ASYNC_2: dec();
89+
__CPROVER_ASYNC_3: dec();
9090

9191
return 0;
9292
}

regression/cbmc-concurrency/conditional_spawn2/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ int main()
1616
__CPROVER_ASYNC_1: thread();
1717
}
1818

19-
__CPROVER_ASYNC_1: thread();
20-
__CPROVER_ASYNC_1: thread();
19+
__CPROVER_ASYNC_2: thread();
20+
__CPROVER_ASYNC_3: thread();
2121

2222
__CPROVER_assert(n<4, "3 threads spawned");
2323

regression/cbmc-concurrency/generic_hw_sw_benchmark1/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#ifdef _ENABLE_CBMC_
1010

11-
#define ASYNC(c) __CPROVER_ASYNC_1: (c)
11+
#define ASYNC(n, c) __CPROVER_ASYNC_ ## n: (c)
1212
#define ATOMIC_BEGIN __CPROVER_atomic_begin()
1313
#define ATOMIC_END __CPROVER_atomic_end()
1414

@@ -233,7 +233,7 @@ void* write_data_register(struct Hardware *hw, RegisterId reg_id, Register value
233233
pthread_create(&interrupt_thread, NULL, hw->interrupt_handler, (void *) hw->fw);
234234
}
235235
#else
236-
ASYNC(hw->interrupt_handler((void *) hw->fw));
236+
ASYNC(1, hw->interrupt_handler((void *) hw->fw));
237237
#endif
238238

239239
SKIP:
@@ -346,7 +346,7 @@ int main(void)
346346
pthread_t firmware_thread;
347347
pthread_create(&firmware_thread, NULL, poll, (void *) fw);
348348
#else
349-
ASYNC(poll((void *) fw));
349+
ASYNC(1, poll((void *) fw));
350350
#endif
351351

352352
#ifdef _EXPOSE_BUG_
@@ -358,7 +358,7 @@ int main(void)
358358
pthread_t stimulus_thread;
359359
pthread_create(&stimulus_thread, NULL, stimulus, (void *) hw);
360360
#else
361-
ASYNC(stimulus((void *) hw));
361+
ASYNC(2, stimulus((void *) hw));
362362
#endif
363363

364364
#ifdef _EXPOSE_BUG_

regression/cbmc-concurrency/invalid_object1/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ static signed int ethoc_reset(struct ethoc *dev)
283283
__CPROVER_ASYNC_1:
284284
open_eth_reg_write(dev->open_eth, (unsigned int)0, mode);
285285

286-
__CPROVER_ASYNC_1:
286+
__CPROVER_ASYNC_2:
287287
open_eth_reg_write(dev->open_eth, (unsigned int)0, mode);
288288
return 0;
289289
}

regression/cbmc-concurrency/recursion1/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ int main()
1313

1414
start2:
1515
(void)0;
16-
__CPROVER_ASYNC_1:
16+
__CPROVER_ASYNC_2:
1717
goto start2;
1818

1919
rec_spawn();

regression/cbmc-concurrency/svcomp13_qrcu_safe/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ void* qrcu_updater() {
118118

119119
int main() {
120120
__CPROVER_ASYNC_1: qrcu_reader1();
121-
__CPROVER_ASYNC_1: qrcu_reader2();
122-
__CPROVER_ASYNC_1: qrcu_updater();
121+
__CPROVER_ASYNC_2: qrcu_reader2();
122+
__CPROVER_ASYNC_3: qrcu_updater();
123123
return 0;
124124
}

regression/cbmc-concurrency/svcomp13_qrcu_unsafe/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ void* qrcu_updater() {
118118

119119
int main() {
120120
__CPROVER_ASYNC_1: qrcu_reader1();
121-
__CPROVER_ASYNC_1: qrcu_reader2();
122-
__CPROVER_ASYNC_1: qrcu_updater();
121+
__CPROVER_ASYNC_2: qrcu_reader2();
122+
__CPROVER_ASYNC_3: qrcu_updater();
123123
return 0;
124124
}

regression/cbmc-concurrency/svcomp13_read_write_lock_safe/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ void *reader() { //reader
3939

4040
int main() {
4141
__CPROVER_ASYNC_1: writer();
42-
__CPROVER_ASYNC_1: reader();
43-
__CPROVER_ASYNC_1: writer();
44-
__CPROVER_ASYNC_1: reader();
42+
__CPROVER_ASYNC_2: reader();
43+
__CPROVER_ASYNC_3: writer();
44+
__CPROVER_ASYNC_4: reader();
4545
return 0;
4646
}

0 commit comments

Comments
 (0)