Debian Codegraph @

clang/test/Modules/no-import-func-body.cppm

raw
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
3 // RUN: cd %t
4 //
5 // RUN: %clang_cc1 -std=c++20 -O1 -triple %itanium_abi_triple %t/a.cppm \
6 // RUN: -emit-module-interface -o %t/a.pcm
7 // RUN: %clang_cc1 -std=c++20 -O1 -triple %itanium_abi_triple %t/b.cppm \
8 // RUN: -emit-module-interface -fprebuilt-module-path=%t -o %t/b.pcm
9 // RUN: %clang_cc1 -std=c++20 -O1 -triple %itanium_abi_triple %t/c.cppm \
10 // RUN: -emit-module-interface -fprebuilt-module-path=%t -o %t/c.pcm
11 // RUN: %clang_cc1 -std=c++20 -O1 -triple %itanium_abi_triple %t/c.pcm \
12 // RUN: -fprebuilt-module-path=%t -emit-llvm -disable-llvm-passes -o - \
13 // RUN: | FileCheck %t/c.cppm
14
15 //--- a.cppm
16 export module a;
17 export int a() {
18 return 43;
19 }
20 export __attribute__((noinline)) int a_noinline() {
21 return 44;
22 }
23
24 //--- b.cppm
25 export module b;
26 export import a;
27 export int b() {
28 return 43 + a();
29 }
30
31 export __attribute__((noinline)) int b_noinline() {
32 return 43 + a();
33 }
34
35 //--- c.cppm
36 export module c;
37 export import b;
38 export int c() {
39 return 43 + b() + a() + b_noinline() + a_noinline();
40 }
41
42 // CHECK: declare{{.*}}@_ZW1b1bv(
43 // CHECK: declare{{.*}}@_ZW1a1av(
44
45 // CHECK: declare{{.*}}@_ZW1b10b_noinlinev()
46 // CHECK: declare{{.*}}@_ZW1a10a_noinlinev()