EricWF added a comment. OK, IMO the way to handle this test is to have it manually link `-latomic`. This can be done by renaming the test to `<test>.sh.cpp` and adding the following lines: // REQUIRES: libatomic // RUN: %build -latomic // RUN: %run After that this LGTM. https://reviews.llvm.org/D22073