brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · f3a7e47 Raw
67 lines · cpp
1// RUN: rm -rf %t2// RUN: mkdir -p %t3// RUN: split-file %s %t4 5// RUN: %clang_cc1 -std=c++20 -emit-header-unit -xc++-user-header %t/hu-01.h \6// RUN:  -o %t/hu-01.pcm7 8// RUN: %clang_cc1 -std=c++20 -emit-header-unit -xc++-user-header %t/hu-02.h \9// RUN:  -Wno-experimental-header-units -fmodule-file=%t/hu-01.pcm -o %t/hu-02.pcm10 11// RUN: %clang_cc1 -std=c++20 -emit-header-unit -xc++-user-header %t/hu-03.h \12// RUN:  -Wno-experimental-header-units \13// RUN:  -fmodule-file=%t/hu-01.pcm -o %t/hu-03.pcm14 15// RUN: %clang_cc1 -std=c++20 -emit-header-unit -xc++-user-header %t/hu-04.h \16// RUN:  -Wno-experimental-header-units -fmodule-file=%t/hu-02.pcm \17// RUN:  -fmodule-file=%t/hu-03.pcm -o %t/hu-04.pcm18 19// RUN: %clang_cc1 -std=c++20 -emit-obj %t/main.cpp \20// RUN:  -Wno-experimental-header-units -fmodule-file=%t/hu-04.pcm21//--- hu-01.h22template <typename T>23struct A {24  ~A() { f(); }25  auto f() const { return 0; }26};27 28template <typename T>29struct B {30  int g() const { return a.f(); }31  A<T> a;32};33 34//--- hu-02.h35import "hu-01.h";36 37template <typename = void>38struct C {39  void h() {40    B<int>().g();41  }42};43 44template struct A<double>;45 46//--- hu-03.h47import "hu-01.h";48 49inline B<int> b() {50  return {};51}52 53//--- hu-04.h54import "hu-02.h";55import "hu-03.h";56 57inline void f4() {58  C{}.h();59}60 61//--- main.cpp62import "hu-04.h";63 64int main() {65  f4();66}67