diff options
| -rw-r--r-- | clang/test/Modules/avoid-specialization-update-in-reduced-bmi.cppm | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/clang/test/Modules/avoid-specialization-update-in-reduced-bmi.cppm b/clang/test/Modules/avoid-specialization-update-in-reduced-bmi.cppm new file mode 100644 index 0000000..7844344 --- /dev/null +++ b/clang/test/Modules/avoid-specialization-update-in-reduced-bmi.cppm @@ -0,0 +1,28 @@ +// RUN: rm -rf %t +// RUN: split-file %s %t +// +// RUN: %clang_cc1 -std=c++20 %t/base.cppm -emit-module-interface -o %t/base.pcm +// RUN: %clang_cc1 -std=c++20 %t/update.cppm -fmodule-file=base=%t/base.pcm -emit-module-interface -o %t/update.pcm +// RUN: llvm-bcanalyzer --dump --disable-histogram %t/update.pcm | FileCheck %t/update.cppm --check-prefix=FULL +// +// RUN: %clang_cc1 -std=c++20 %t/base.cppm -emit-reduced-module-interface -o %t/base.pcm +// RUN: %clang_cc1 -std=c++20 %t/update.cppm -fmodule-file=base=%t/base.pcm -emit-reduced-module-interface -o %t/update.pcm +// RUN: llvm-bcanalyzer --dump --disable-histogram %t/update.pcm | FileCheck %t/update.cppm + +//--- base.cppm +export module base; + +export template <typename T> +struct base { + T value; +}; + +//--- update.cppm +export module update; +import base; +export int update() { + return base<int>().value; +} + +// FULL: TEMPLATE_SPECIALIZATION +// CHECK-NOT: TEMPLATE_SPECIALIZATION |
