3 // RUN: split-file %s %t
5 // RUN: %clang_cc1 -std=c++20 -emit-module-interface -triple %itanium_abi_triple %t/parta.cppm -o %t/mod-parta.pcm
6 // RUN: %clang_cc1 -std=c++20 -emit-module-interface -triple %itanium_abi_triple %t/partb.cppm -o %t/mod-partb.pcm
7 // RUN: %clang_cc1 -std=c++20 -emit-module-interface -triple %itanium_abi_triple -fmodule-file=%t/mod-parta.pcm \
8 // RUN: -fmodule-file=%t/mod-partb.pcm %t/mod.cppm -o %t/mod.pcm
9 // RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/mod.pcm -S -emit-llvm -disable-llvm-passes -o - \
10 // RUN: | FileCheck %t/mod.cppm
11 // RUN: %clang_cc1 -std=c++20 -O2 -emit-module-interface -triple %itanium_abi_triple -fmodule-file=%t/mod-parta.pcm \
12 // RUN: -fmodule-file=%t/mod-partb.pcm %t/mod.cppm -o %t/mod.pcm
13 // RUN: %clang_cc1 -std=c++20 -O2 -triple %itanium_abi_triple %t/mod.pcm -S -emit-llvm -disable-llvm-passes -o - \
14 // RUN: | FileCheck %t/mod.cppm -check-prefix=CHECK-OPT
17 export module mod
:parta
;
39 return foo() + bar() + a
+ b
;
42 // FIXME: The definition of the variables shouldn't be exported too.
43 // CHECK: @_ZW3mod1a = available_externally global
44 // CHECK: @_ZW3mod1b = available_externally global
45 // CHECK: declare{{.*}} i32 @_ZW3mod3foov
46 // CHECK: declare{{.*}} i32 @_ZW3mod3barv
48 // CHECK-OPT: @_ZW3mod1a = available_externally global
49 // CHECK-OPT: @_ZW3mod1b = available_externally global
50 // CHECK-OPT: declare{{.*}} i32 @_ZW3mod3foov
51 // CHECK-OPT: declare{{.*}} i32 @_ZW3mod3barv