1 // REQUIRES: !system-windows
4 // RUN: split-file %s %t
7 // RUN: %clang_cc1 -std=c++20 %t/layer1.cppm -triple %itanium_abi_triple \
8 // RUN: -emit-module-interface -o %t/foo-layer1.pcm
9 // RUN: %clang_cc1 -std=c++20 %t/layer2.cppm -triple %itanium_abi_triple \
10 // RUN: -emit-module-interface -fmodule-file=foo:layer1=%t/foo-layer1.pcm \
11 // RUN: -o %t/foo-layer2.pcm
12 // RUN: %clang_cc1 -std=c++20 %t/foo-layer1.pcm -emit-llvm -o - | FileCheck %t/layer1.cppm
13 // RUN: %clang_cc1 -std=c++20 %t/foo-layer2.pcm -emit-llvm -o - \
14 // RUN: -fmodule-file=foo:layer1=%t/foo-layer1.pcm | FileCheck %t/layer2.cppm
16 // Check the case about emitting object files from sources directly.
17 // RUN: %clang_cc1 -std=c++20 %t/layer1.cppm -triple %itanium_abi_triple \
18 // RUN: -emit-llvm -o - | FileCheck %t/layer1.cppm
19 // RUN: %clang_cc1 -std=c++20 %t/layer2.cppm -triple %itanium_abi_triple -emit-llvm \
20 // RUN: -fmodule-file=foo:layer1=%t/foo-layer1.pcm -o - | FileCheck %t/layer2.cppm
23 export module foo:layer1;
25 virtual ~Fruit() = default;
29 // CHECK-DAG: @_ZTVW3foo5Fruit = unnamed_addr constant
30 // CHECK-DAG: @_ZTSW3foo5Fruit = constant
31 // CHECK-DAG: @_ZTIW3foo5Fruit = constant
34 // (1) The use of virtual functions won't produce the vtable.
35 // (2) The definition of key functions won't produce the vtable.
38 export module foo:layer2;
40 export void layer2_fun() {
41 Fruit *b = new Fruit();
45 // CHECK: @_ZTVW3foo5Fruit = external unnamed_addr constant
46 // CHECK-NOT: @_ZTSW3foo5Fruit
47 // CHECK-NOT: @_ZTIW3foo5Fruit