brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · d44a4f4 Raw
48 lines · plain
1// REQUIRES: !system-windows, !system-cygwin2 3// RUN: rm -rf %t4// RUN: split-file %s %t5// RUN: cd %t6//7// RUN: %clang_cc1 -std=c++20 %t/layer1.cppm -triple %itanium_abi_triple \8// RUN:     -emit-module-interface -o %t/foo-layer1.pcm9// 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.pcm12// RUN: %clang_cc1 -std=c++20 %t/foo-layer1.pcm -emit-llvm -o - | FileCheck %t/layer1.cppm13// 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.cppm15//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.cppm19// 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.cppm21 22//--- layer1.cppm23export module foo:layer1;24struct Fruit {25    virtual ~Fruit() = default;26    virtual void eval();27};28 29// CHECK-DAG: @_ZTVW3foo5Fruit = unnamed_addr constant30// CHECK-DAG: @_ZTSW3foo5Fruit = constant31// CHECK-DAG: @_ZTIW3foo5Fruit = constant32 33// Testing that:34// (1) The use of virtual functions won't produce the vtable.35// (2) The definition of key functions won't produce the vtable.36//37//--- layer2.cppm38export module foo:layer2;39import :layer1;40export void layer2_fun() {41    Fruit *b = new Fruit();42    b->eval();43}44void Fruit::eval() {}45// CHECK: @_ZTVW3foo5Fruit = external unnamed_addr constant46// CHECK-NOT: @_ZTSW3foo5Fruit47// CHECK-NOT: @_ZTIW3foo5Fruit48