brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 57a1f11 Raw
35 lines · plain
1// RUN: rm -rf %t2// RUN: mkdir %t3// RUN: split-file %s %t4//5// RUN: %clang -std=c++20 -Wno-experimental-header-units -fmodule-header %t/RelaxedAtomic.h -o %t/RelaxedAtomic.pcm6// RUN: %clang -std=c++20 -Wno-experimental-header-units -fmodule-header -fmodule-file=%t/RelaxedAtomic.pcm %t/SharedMutex.h -o %t/SharedMutex.pcm7// RUN: %clang -std=c++20 -Wno-experimental-header-units -fmodule-header -fmodule-file=%t/SharedMutex.pcm -fmodule-file=%t/RelaxedAtomic.pcm %t/ThreadLocalDetail.h -o %t/ThreadLocalDetail.pcm8//--- RelaxedAtomic.h9struct relaxed_atomic_base {10  relaxed_atomic_base(int) {}11};12 13struct relaxed_atomic : relaxed_atomic_base {14  using relaxed_atomic_base::relaxed_atomic_base; // constructor15};16 17//--- SharedMutex.h18import "RelaxedAtomic.h";19 20inline void getMaxDeferredReaders() {21  static relaxed_atomic cache{0};22}23 24//--- ThreadLocalDetail.h25import "RelaxedAtomic.h";26 27struct noncopyable {28  noncopyable(const noncopyable&) = delete;29};30 31struct StaticMetaBase {32  relaxed_atomic nextId_{0};33  noncopyable ncp;34};35