gcc/testsuite/g++.dg/modules/internal-12_a.C
raw| 1 | // PR c++/119551 |
| 2 | // { dg-additional-options "-fmodules" } |
| 3 | // { dg-module-cmi M } |
| 4 | // Test that emitting variables referencing TU-local entities |
| 5 | // builds and runs correctly. |
| 6 | |
| 7 | export module M; |
| 8 | |
| 9 | static int tu_local_var = 5; |
| 10 | static int* tu_local_func() { return &tu_local_var; } |
| 11 | |
| 12 | export int* a = &tu_local_var; |
| 13 | export inline int* b = tu_local_func(); |