clang/test/Modules/static-initializer.cppm
raw| 1 | // RUN: rm -rf %t |
| 2 | // RUN: mkdir -p %t |
| 3 | // RUN: split-file %s %t |
| 4 | // |
| 5 | // RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm |
| 6 | // RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/a.cpp -fmodule-file=a=%t/a.pcm -emit-llvm -o - | FileCheck %t/a.cpp |
| 7 | |
| 8 | //--- a.cppm |
| 9 | export module a; |
| 10 | int func(); |
| 11 | static int a = func(); |
| 12 | |
| 13 | //--- a.cpp |
| 14 | import a; |
| 15 | |
| 16 | // CHECK-NOT: internal global |
| 17 | // CHECK-NOT: __cxx_global_var_init |
| 18 |