48 lines · cpp
1// RUN: rm -rf %t2// RUN: mkdir -p %t3// RUN: split-file %s %t4 5// RUN: %clang_cc1 -std=c++20 -fmodule-name=hu-01 -emit-header-unit -xc++-user-header %t/hu-01.h \6// RUN: -o %t/hu-01.pcm7 8// RUN: %clang_cc1 -std=c++20 -fmodule-name=hu-02 -emit-header-unit -xc++-user-header %t/hu-02.h \9// RUN: -Wno-experimental-header-units \10// RUN: -fmodule-map-file=%t/hu-01.map -fmodule-file=hu-01=%t/hu-01.pcm \11// RUN: -o %t/hu-02.pcm12 13// RUN: %clang_cc1 -std=c++20 -emit-obj %t/main.cpp \14// RUN: -Wno-experimental-header-units \15// RUN: -fmodule-map-file=%t/hu-01.map -fmodule-file=hu-01=%t/hu-01.pcm \16// RUN: -fmodule-map-file=%t/hu-02.map -fmodule-file=hu-02=%t/hu-02.pcm17 18//--- hu-01.map19module "hu-01" {20 header "hu-01.h"21 export *22}23 24//--- hu-02.map25module "hu-02" {26 header "hu-02.h"27 export *28}29 30//--- hu-01.h31template <typename T>32struct S { union { T x; }; };33 34using SI = S<int>;35 36//--- hu-02.h37template <typename T>38struct S { union { T x; }; };39 40inline void f(S<int> s = {}) { s.x; }41 42//--- main.cpp43import "hu-01.h";44void g(S<int>) {}45 46import "hu-02.h";47void h() { f(); }48