41 lines · plain
1// Although the reduced BMI are not designed to be generated,2// it is helpful for testing whether we've reduced the definitions.3//4// RUN: rm -rf %t5// RUN: mkdir -p %t6// RUN: split-file %s %t7//8// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/a.cppm \9// RUN: -emit-reduced-module-interface -o %t/a.pcm10// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/b.cpp \11// RUN: -fmodule-file=a=%t/a.pcm -emit-llvm -o - \12// RUN: | FileCheck %t/b.cpp13 14//--- a.cppm15export module a;16 17export template <class T>18class A {19public:20 int member() {21 return 43;22 }23};24 25// Instantiate `A<int>::member()`.26export int a_member = A<int>().member();27 28export const int a = 43;29 30//--- b.cpp31import a;32 33static_assert(a == 43);34 35int b() {36 A<int> a;37 return a.member();38}39 40// CHECK: define{{.*}}@_ZNW1a1AIiE6memberEv41