diff options
| author | Michael Kruse <llvm-project@meinersbur.de> | 2025-01-03 10:22:51 +0100 |
|---|---|---|
| committer | Michael Kruse <llvm-project@meinersbur.de> | 2025-01-03 10:22:51 +0100 |
| commit | 38500d63e14ce340236840f60d356cdefb56a52c (patch) | |
| tree | 17edbec446ce9b50d2f215a483b83afb293a635d /clang/test/Modules/pr120277.cppm | |
| parent | 1a3d5daaef7a6a63448a497da3eff7fc9e23df26 (diff) | |
| parent | 27f30029741ecf023baece7b3dde1ff9011ffefc (diff) | |
Merge branch 'main' into users/meinersbur/flang_runtime_split-headersusers/meinersbur/flang_runtime_split-headers
Diffstat (limited to 'clang/test/Modules/pr120277.cppm')
| -rw-r--r-- | clang/test/Modules/pr120277.cppm | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/clang/test/Modules/pr120277.cppm b/clang/test/Modules/pr120277.cppm new file mode 100644 index 000000000000..a4f55ef113b2 --- /dev/null +++ b/clang/test/Modules/pr120277.cppm @@ -0,0 +1,58 @@ +// RUN: rm -rf %t +// RUN: mkdir -p %t +// RUN: split-file %s %t +// +// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm +// RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-module-interface -o %t/b.pcm \ +// RUN: -fprebuilt-module-path=%t +// RUN: %clang_cc1 -std=c++20 %t/c.cppm -emit-module-interface -o %t/c.pcm \ +// RUN: -fprebuilt-module-path=%t +// RUN: %clang_cc1 -std=c++20 %t/d.cppm -emit-module-interface -o %t/d.pcm \ +// RUN: -fprebuilt-module-path=%t +// RUN: %clang_cc1 -std=c++20 %t/d.pcm -emit-llvm -o %t/d.ll \ +// RUN: -fprebuilt-module-path=%t +// RUN: cat %t/d.ll | FileCheck %t/d.cppm + +//--- a.cppm +export module a; + +export template<int> +struct a { + static auto f() { + } +}; + +//--- b.cppm +export module b; + +import a; + +void b() { + a<0> t; +} + +//--- c.cppm +export module c; + +import a; + +void c() { + a<0>::f(); +} + +//--- d.cppm +export module d; + +import a; +import b; +import c; + +struct d { + static void g() { + a<0>::f(); + a<1>::f(); + } +}; + +// fine enough to check it won't crash +// CHECK: define |
