59 lines · plain
1// RUN: rm -rf %t2// RUN: mkdir -p %t3// RUN: split-file %s %t4//5// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm6// RUN: %clang_cc1 -std=c++20 %t/a.cpp -fmodule-file=a=%t/a.pcm -ast-dump | FileCheck %s7 8// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm9// RUN: %clang_cc1 -std=c++20 %t/a.cpp -fmodule-file=a=%t/a.pcm -ast-dump | FileCheck %s10 11//--- a.h12namespace a {13class A {14public:15 int aaaa;16 17 int get() {18 return aaaa;19 }20};21 22 23template <class T>24class B {25public:26 B(T t): t(t) {}27 T t;28};29 30using BI = B<int>;31 32inline int get(A a, BI b) {33 return a.get() + b.t;34}35 36}37 38//--- a.cppm39export module a;40 41export extern "C++" {42#include "a.h"43}44 45//--- a.cpp46import a;47#include "a.h"48 49int test() {50 a::A aa;51 a::BI bb(43);52 return get(aa, bb);53}54 55// CHECK-NOT: DefinitionData56// CHECK: FunctionDecl {{.*}} get 'int (A, BI)' {{.*}}57// CHECK-NOT: CompoundStmt58// CHECK: FunctionDecl {{.*}} test {{.*}}59