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-module-interface -o %t/a.pcm6// RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-module-interface -o %t/b.pcm \7// RUN: -fprebuilt-module-path=%t8// RUN: %clang_cc1 -std=c++20 %t/c.cppm -emit-module-interface -o %t/c.pcm \9// RUN: -fprebuilt-module-path=%t10// RUN: %clang_cc1 -std=c++20 %t/d.cppm -emit-module-interface -o %t/d.pcm \11// RUN: -fprebuilt-module-path=%t12// RUN: %clang_cc1 -std=c++20 %t/d.pcm -emit-llvm -o %t/d.ll \13// RUN: -fprebuilt-module-path=%t14// RUN: cat %t/d.ll | FileCheck %t/d.cppm15 16//--- a.cppm17export module a;18 19export template<int>20struct a {21 static auto f() {22 }23};24 25//--- b.cppm26export module b;27 28import a;29 30void b() {31 a<0> t;32}33 34//--- c.cppm35export module c;36 37import a;38 39void c() {40 a<0>::f();41}42 43//--- d.cppm44export module d;45 46import a;47import b;48import c;49 50struct d {51 static void g() {52 a<0>::f();53 a<1>::f();54 }55};56 57// fine enough to check it won't crash58// CHECK: define59