1 // REQUIRES: !system-windows
4 // RUN: split-file %s %t
7 // RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 -emit-module-interface \
8 // RUN: %t/Mod.cppm -o %t/Mod.pcm
10 // RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/Mod.pcm \
11 // RUN: -emit-llvm -o - | FileCheck %t/Mod.cppm
12 // RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 -fmodule-file=Mod=%t/Mod.pcm \
13 // RUN: %t/Use.cpp -emit-llvm -o - | FileCheck %t/Use.cpp
15 // RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 -emit-module-interface \
16 // RUN: %t/Mod.cppm -o %t/Mod.pcm -DKEY_FUNCTION_INLINE
18 // RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/Mod.pcm \
19 // RUN: -emit-llvm -o - | FileCheck %t/Mod.cppm -check-prefix=CHECK-INLINE
20 // RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 -fmodule-file=Mod=%t/Mod.pcm \
21 // RUN: %t/Use.cpp -emit-llvm -o - | FileCheck %t/Use.cpp -check-prefix=CHECK-INLINE
23 // RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 -emit-module-interface \
24 // RUN: %t/M-A.cppm -o %t/M-A.pcm
25 // RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 -fmodule-file=M:A=%t/M-A.pcm \
26 // RUN: %t/M-B.cppm -emit-llvm -o - | FileCheck %t/M-B.cppm
35 #ifdef KEY_FUNCTION_INLINE
40 // CHECK: @_ZTVW3Mod4Base = unnamed_addr constant
41 // CHECK: @_ZTSW3Mod4Base = constant
42 // CHECK: @_ZTIW3Mod4Base = constant
44 // CHECK-INLINE: @_ZTVW3Mod4Base = linkonce_odr {{.*}}unnamed_addr constant
45 // CHECK-INLINE: @_ZTSW3Mod4Base = linkonce_odr {{.*}}constant
46 // CHECK-INLINE: @_ZTIW3Mod4Base = linkonce_odr {{.*}}constant
57 Base* base = new Base();
61 // CHECK-NOT: @_ZTSW3Mod4Base = constant
62 // CHECK-NOT: @_ZTIW3Mod4Base = constant
63 // CHECK: @_ZTVW3Mod4Base = external unnamed_addr
65 // CHECK-INLINE: @_ZTVW3Mod4Base = linkonce_odr {{.*}}unnamed_addr constant
66 // CHECK-INLINE: @_ZTSW3Mod4Base = linkonce_odr {{.*}}constant
67 // CHECK-INLINE: @_ZTIW3Mod4Base = linkonce_odr {{.*}}constant
69 // Check the case that the declaration of the key function comes from another
70 // module unit but the definition of the key function comes from the current
96 // CHECK: @_ZTVW1M1C = unnamed_addr constant
97 // CHECK: @_ZTSW1M1C = constant
98 // CHECK: @_ZTIW1M1C = constant