56 lines · plain
1// From https://github.com/llvm/llvm-project/issues/610672// RUN: rm -rf %t3// RUN: mkdir -p %t4// RUN: split-file %s %t5//6// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/a.cppm \7// RUN: -emit-module-interface -o %t/a.pcm8// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/b.cppm \9// RUN: -emit-module-interface -fmodule-file=a=%t/a.pcm -o %t/b.pcm10// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/b.pcm \11// RUN: -emit-llvm -fmodule-file=a=%t/a.pcm -disable-llvm-passes -o - | FileCheck %t/b.cppm12// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/c.cpp -fmodule-file=a=%t/a.pcm \13// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %t/c.cpp14 15// Test again with reduced BMI16// RUN: rm -rf %t17// RUN: mkdir -p %t18// RUN: split-file %s %t19//20// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/a.cppm \21// RUN: -emit-reduced-module-interface -o %t/a.pcm22// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/b.cppm \23// RUN: -emit-module-interface -fmodule-file=a=%t/a.pcm -o %t/b.pcm24// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/b.pcm \25// RUN: -emit-llvm -fmodule-file=a=%t/a.pcm -disable-llvm-passes -o - | FileCheck %t/b.cppm26// RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/c.cpp -fmodule-file=a=%t/a.pcm \27// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %t/c.cpp28 29//--- a.cppm30export module a;31 32export struct a {33 friend bool operator==(a, a) = default;34};35 36//--- b.cppm37export module b;38 39import a;40 41void b() {42 (void)(a() == a());43}44 45// CHECK: define{{.*}}linkonce_odr{{.*}}@_ZW1aeqS_1aS0_(46 47//--- c.cpp48import a;49 50int c() {51 (void)(a() == a());52 return 0;53}54 55// CHECK: define{{.*}}linkonce_odr{{.*}}@_ZW1aeqS_1aS0_(56