brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · f16b945 Raw
67 lines · plain
1// Testing that adding a new line in a module interface unit won't cause the BMI2// of consuming module unit changes.3//4// RUN: rm -rf %t5// RUN: split-file %s %t6//7// RUN: %clang_cc1 -std=c++20 %t/A.part.cppm -emit-reduced-module-interface -o %t/A-part.pcm8//9// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-reduced-module-interface -o %t/A.v0.pcm \10// RUN:     -fprebuilt-module-path=%t11// RUN: %clang_cc1 -std=c++20 %t/A.v1.cppm -emit-reduced-module-interface -o %t/A.v1.pcm \12// RUN:     -fprebuilt-module-path=%t13//14// The BMI may not be the same since the source location differs.15// RUN: not diff %t/A.pcm %t/A.v1.pcm &> /dev/null16//17// The BMI of B shouldn't change since all the locations remain the same.18// RUN: %clang_cc1 -std=c++20 %t/B.cppm -emit-reduced-module-interface -fmodule-file=A=%t/A.v0.pcm \19// RUN:     -o %t/B.pcm -fprebuilt-module-path=%t20// RUN: %clang_cc1 -std=c++20 %t/B.cppm -emit-reduced-module-interface -fmodule-file=A=%t/A.v1.pcm \21// RUN:     -o %t/B.v1.pcm -fprebuilt-module-path=%t22// RUN: diff %t/B.v1.pcm %t/B.pcm  &> /dev/null23//24// The BMI of C may change since the locations for instantiations changes.25// RUN: %clang_cc1 -std=c++20 %t/C.cppm -emit-reduced-module-interface -fmodule-file=A=%t/A.v0.pcm \26// RUN:     -o %t/C.pcm -fprebuilt-module-path=%t27// RUN: %clang_cc1 -std=c++20 %t/C.cppm -emit-reduced-module-interface -fmodule-file=A=%t/A.v1.pcm \28// RUN:     -o %t/C.v1.pcm -fprebuilt-module-path=%t29// RUN: diff %t/C.v1.pcm %t/C.pcm  &> /dev/null30 31//--- A.part.cppm32export module A:part;33export template <class T>34struct C {35    T func() {36        return T(43);37    }38};39export int funcA() {40    return 43;41}42 43//--- A.cppm44export module A;45export import :part;46 47//--- A.v1.cppm48export module A;49 50export import :part;51 52//--- B.cppm53export module B;54import A;55 56export int funcB() {57    return funcA();58}59 60//--- C.cppm61export module C;62import A;63export inline void testD() {64    C<int> c;65    c.func();66}67