gcc/testsuite/gdc.test/compilable/atomic_loadstore_shared_classes.d
raw| 1 | // REQUIRED_ARGS: -preview=nosharedaccess |
| 2 | import core.atomic; |
| 3 | |
| 4 | class Foo |
| 5 | { |
| 6 | } |
| 7 | |
| 8 | shared Foo toLoad; |
| 9 | |
| 10 | void oops() |
| 11 | { |
| 12 | auto f0 = new shared Foo; |
| 13 | auto f1 = new shared Foo; |
| 14 | atomicStore(f0, f1); |
| 15 | |
| 16 | // https://issues.dlang.org/show_bug.cgi?id=24846 |
| 17 | shared(Foo) f2 = atomicLoad(toLoad); |
| 18 | } |