3 // RUN: split-file %s %t
5 // RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple \
6 // RUN: -emit-module-interface %t/a.cppm -o %t/a.pcm
7 // RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple \
8 // RUN: %t/b.cpp -fmodule-file=a=%t/a.pcm -disable-llvm-passes \
9 // RUN: -emit-llvm -o - | FileCheck %t/b.cpp
10 // RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple \
11 // RUN: %t/c.cpp -fmodule-file=a=%t/a.pcm -disable-llvm-passes \
12 // RUN: -emit-llvm -o - | FileCheck %t/c.cpp
18 explicit operator int() const {
23 export template<typename>
24 int a = static_cast<int>(integer());
31 export template<typename>
35 return a<void> + d<void>;
39 export inline int dynamic_var = dynamic_func();
46 // CHECK-NOT: @_ZW1a1dIvE =
47 // CHECK-NOT: @_ZGVW1a1dIvE =
48 // CHECK-NOT: @_ZW1a11dynamic_var =
49 // CHECK-NOT: @_ZGVW1a11dynamic_var =
50 // CHECK-NOT: @_ZW1a1aIvE =
51 // CHECK-NOT: @_ZGVW1a1aIvE =
56 return a<void> + d<void> + dynamic_var;
59 // The used variables are generated normally
60 // CHECK-DAG: @_ZW1a1aIvE =
61 // CHECK-DAG: @_ZW1a1dIvE =
62 // CHECK-DAG: @_ZW1a11dynamic_var = linkonce_odr
63 // CHECK-DAG: @_ZGVW1a1aIvE =
64 // CHECk-DAG: @_ZGVW1a1dIvE =
65 // CHECK-DAG: @_ZGVW1a11dynamic_var = linkonce_odr