kubabrecka added a comment. Huh, changing `*barrier = count;` in the initialization into: __atomic_store_n(barrier, count, __ATOMIC_RELAXED); fixes the failing test. But I'm not going to pretend that I understand why exactly was it failing... http://reviews.llvm.org/D14434