brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 0e276ad Raw
94 lines · cpp
1// If this test fails, it should be investigated under Debug builds.2// Before the PR, this test was encountering an `llvm_unreachable()`.3 4// RUN: rm -rf %t5// RUN: mkdir -p %t6// RUN: split-file %s %t7// RUN: cd %t8 9// RUN: %clang_cc1 -std=c++20 -emit-header-unit -xc++-user-header %t/hu-01.h \10// RUN:  -fcxx-exceptions -o %t/hu-01.pcm11 12// RUN: %clang_cc1 -std=c++20 -emit-header-unit -xc++-user-header %t/hu-02.h \13// RUN:  -Wno-experimental-header-units -fcxx-exceptions \14// RUN:  -fmodule-file=%t/hu-01.pcm -o %t/hu-02.pcm15 16// RUN: %clang_cc1 -std=c++20 -emit-header-unit -xc++-user-header %t/hu-03.h \17// RUN:  -Wno-experimental-header-units -fcxx-exceptions \18// RUN:  -fmodule-file=%t/hu-01.pcm -o %t/hu-03.pcm19 20// RUN: %clang_cc1 -std=c++20 -emit-header-unit -xc++-user-header %t/hu-04.h \21// RUN:  -Wno-experimental-header-units -fcxx-exceptions \22// RUN:  -fmodule-file=%t/hu-01.pcm -o %t/hu-04.pcm23 24// RUN: %clang_cc1 -std=c++20 -emit-header-unit -xc++-user-header %t/hu-05.h \25// RUN:  -Wno-experimental-header-units -fcxx-exceptions \26// RUN:  -fmodule-file=%t/hu-03.pcm -fmodule-file=%t/hu-04.pcm \27// RUN:  -fmodule-file=%t/hu-01.pcm -o %t/hu-05.pcm28 29// RUN: %clang_cc1 -std=c++20 -emit-obj %t/main.cpp \30// RUN:  -Wno-experimental-header-units -fcxx-exceptions \31// RUN:  -fmodule-file=%t/hu-02.pcm -fmodule-file=%t/hu-05.pcm \32// RUN:  -fmodule-file=%t/hu-04.pcm -fmodule-file=%t/hu-03.pcm \33// RUN:  -fmodule-file=%t/hu-01.pcm34 35//--- hu-01.h36template <typename T>37struct A {38  A() {}39  ~A() {}40};41 42template <typename T>43struct EBO : T {44  EBO() = default;45};46 47template <typename T>48struct HT : EBO<A<T>> {};49 50//--- hu-02.h51import "hu-01.h";52 53inline void f() {54  HT<int>();55}56 57//--- hu-03.h58import "hu-01.h";59 60struct C {61  C();62 63  HT<long> _;64};65 66//--- hu-04.h67import "hu-01.h";68 69void g(HT<long> = {});70 71//--- hu-05.h72import "hu-03.h";73import "hu-04.h";74import "hu-01.h";75 76struct B {77  virtual ~B() = default;78 79  virtual void f() {80    HT<long>();81  }82};83 84//--- main.cpp85import "hu-02.h";86import "hu-05.h";87import "hu-03.h";88 89int main() {90  f();91  C();92  B();93}94