Skip to content

Commit 64810c0

Browse files
author
Justin Boswell
authored
Removed test for undefined behavior in atomics (awslabs#599)
1 parent 5451686 commit 64810c0

File tree

2 files changed

+0
-48
lines changed

2 files changed

+0
-48
lines changed

tests/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,6 @@ add_test_case(atomics_semantics)
291291
add_test_case(atomics_semantics_implicit)
292292
add_test_case(atomics_static_init)
293293

294-
# atomics aren't 'fully' supported on gcc 4.1.2
295-
if (NOT LEGACY_COMPILER_SUPPORT)
296-
add_test_case(atomics_loads_reordered_with_older_stores)
297-
endif()
298-
299294
add_test_case(atomics_acquire_to_release_one_direction)
300295
add_test_case(atomics_acquire_to_release_mixed)
301296

tests/atomics_test.c

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -362,49 +362,6 @@ static void notify_race_completed(void) {
362362
} \
363363
static void race_name##_iter(int vn_participant, struct one_race *vn_race) /* NOLINT */
364364

365-
/*
366-
* See http://www.cs.cmu.edu/~410-f10/doc/Intel_Reordering_318147.pdf #2.3
367-
*/
368-
DEFINE_RACE(loads_reordered_with_older_stores, participant, race) {
369-
struct aws_atomic_var *my_var = race->vars[participant];
370-
struct aws_atomic_var *their_var = race->vars[1 - participant];
371-
struct aws_atomic_var *observed = race->observations[participant];
372-
/*
373-
* This test may fail with any other ordering, even on the relatively relaxed x86 architecture.
374-
* This failure seems relatively easy to reproduce, so this is a good way to test for seq_cst ordering.
375-
*/
376-
enum aws_memory_order store_order = aws_memory_order_seq_cst;
377-
enum aws_memory_order load_order = aws_memory_order_seq_cst;
378-
379-
aws_atomic_store_int_explicit(my_var, 1, store_order);
380-
aws_atomic_store_int_explicit(
381-
observed, aws_atomic_load_int_explicit(their_var, load_order), aws_memory_order_relaxed);
382-
}
383-
384-
AWS_TEST_CASE(atomics_loads_reordered_with_older_stores, t_loads_reordered_with_older_stores)
385-
static int t_loads_reordered_with_older_stores(struct aws_allocator *allocator, void *ctx) {
386-
(void)ctx;
387-
388-
struct aws_atomic_var template[2];
389-
size_t last_race;
390-
aws_atomic_init_int(&template[0], 0);
391-
aws_atomic_init_int(&template[1], 0);
392-
393-
setup_races(allocator, 100000, 2, 2, template, template);
394-
run_races(&last_race, allocator, 2, loads_reordered_with_older_stores);
395-
396-
for (size_t i = 0; i < last_race; i++) {
397-
size_t a = aws_atomic_load_int_explicit(races[i].observations[0], aws_memory_order_relaxed);
398-
size_t b = aws_atomic_load_int_explicit(races[i].observations[1], aws_memory_order_relaxed);
399-
400-
ASSERT_TRUE(a || b, "Race at iteration %zu", i);
401-
}
402-
403-
free_races(allocator);
404-
405-
return 0;
406-
}
407-
408365
/*
409366
* The following race races these two threads:
410367
*

0 commit comments

Comments
 (0)