brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 1465c33 Raw
65 lines · plain
1// This comes from the issue report of MSVC2// (https://developercommunity.visualstudio.com/t/c20-modules-unresolved-external-symbol/10049210).3//4// RUN: rm -rf %t5// RUN: mkdir %t6// RUN: split-file %s %t7//8// RUN: %clang_cc1 -std=c++20 %t/base.cppm -emit-module-interface -o %t/package-base.pcm9// RUN: %clang_cc1 -std=c++20 %t/child.cppm -emit-module-interface -o %t/package-child.pcm \10// RUN:     -fprebuilt-module-path=%t11// RUN: %clang_cc1 -std=c++20 %t/package.cppm -emit-module-interface -o %t/package.pcm \12// RUN:     -fprebuilt-module-path=%t13// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fsyntax-only -verify -fprebuilt-module-path=%t14 15// Test again with reduced BMI16// RUN: rm -rf %t17// RUN: mkdir %t18// RUN: split-file %s %t19//20// RUN: %clang_cc1 -std=c++20 %t/base.cppm -emit-reduced-module-interface -o %t/package-base.pcm21// RUN: %clang_cc1 -std=c++20 %t/child.cppm -emit-reduced-module-interface -o %t/package-child.pcm \22// RUN:     -fprebuilt-module-path=%t23// RUN: %clang_cc1 -std=c++20 %t/package.cppm -emit-reduced-module-interface -o %t/package.pcm \24// RUN:     -fprebuilt-module-path=%t25// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fsyntax-only -verify -fprebuilt-module-path=%t26 27//--- base.cppm28export module package:base;29 30export struct child;31 32export33template<class> struct base34{35	child getChild();36};37 38 39//--- child.cppm40export module package:child;41 42import :base;43 44export struct child : base<void> {};45 46template<class T>47child base<T>::getChild() { return {}; }48 49//--- package.cppm50export module package;51 52export import :base;53export import :child;54 55//--- use.cpp56// expected-no-diagnostics57import package;58 59int use()60{61	base<void>{}.getChild();62	base<int>{}.getChild();63	return 0;64}65