37 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-reduced-module-interface -o %t/a.reduced.pcm6// RUN: %clang_cc1 -std=c++20 %t/a.cppm -fexperimental-modules-reduced-bmi -fmodule-output=%t/a.pcm \7// RUN: -emit-llvm -o %t/a.ll8//9// Test that the generated BMI from `-fexperimental-modules-reduced-bmi -fmodule-output=` is same with10// `-emit-reduced-module-interface`.11// RUN: diff %t/a.reduced.pcm %t/a.pcm12//13// Test that we can consume the produced BMI correctly.14// RUN: %clang_cc1 -std=c++20 %t/b.cppm -fmodule-file=a=%t/a.pcm -fsyntax-only -verify15//16// RUN: rm -f %t/a.pcm17// RUN: %clang_cc1 -std=c++20 %t/a.cppm -fexperimental-modules-reduced-bmi -fmodule-output=%t/a.pcm \18// RUN: -emit-module-interface -o %t/a.full.pcm19// RUN: diff %t/a.reduced.pcm %t/a.pcm20// RUN: not diff %t/a.pcm %t/a.full.pcm21//22// RUN: %clang_cc1 -std=c++20 %t/b.cppm -fmodule-file=a=%t/a.pcm -fsyntax-only -verify23// RUN: %clang_cc1 -std=c++20 %t/b.cppm -fmodule-file=a=%t/a.full.pcm -fsyntax-only -verify24 25//--- a.cppm26export module a;27export int a() {28 return 43;29}30 31//--- b.cppm32// Test that we can consume the produced BMI correctly as a smocking test.33// expected-no-diagnostics34export module b;35import a;36export int b() { return a(); }37