Debian Codegraph @

clang/test/Modules/pr61065.cppm

raw
1 // From https://github.com/llvm/llvm-project/issues/61065
2 // RUN: rm -rf %t
3 // RUN: mkdir -p %t
4 // RUN: split-file %s %t
5 //
6 // RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm
7 // RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-module-interface -o %t/b.pcm \
8 // RUN: -fprebuilt-module-path=%t
9 // RUN: %clang_cc1 -std=c++20 %t/c.cppm -emit-module-interface -o %t/c.pcm \
10 // RUN: -fprebuilt-module-path=%t
11 // RUN: %clang_cc1 -std=c++20 %t/d.cpp -fsyntax-only -verify -fprebuilt-module-path=%t
12
13 // Test again with reduced BMI
14 // RUN: rm -rf %t
15 // RUN: mkdir -p %t
16 // RUN: split-file %s %t
17 //
18 // RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
19 // RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-reduced-module-interface -o %t/b.pcm \
20 // RUN: -fprebuilt-module-path=%t
21 // RUN: %clang_cc1 -std=c++20 %t/c.cppm -emit-reduced-module-interface -o %t/c.pcm \
22 // RUN: -fprebuilt-module-path=%t
23 // RUN: %clang_cc1 -std=c++20 %t/d.cpp -fsyntax-only -verify -fprebuilt-module-path=%t
24
25
26 //--- a.cppm
27 export module a;
28
29 struct base {
30 base(int) {}
31 };
32
33 export struct a : base {
34 using base::base;
35 };
36
37 //--- b.cppm
38 export module b;
39
40 import a;
41
42 a b() {
43 return a(1);
44 }
45
46 //--- c.cppm
47 export module c;
48
49 import a;
50 import b;
51
52 struct noncopyable {
53 noncopyable(noncopyable const &) = delete;
54 noncopyable() = default;
55 };
56
57 export struct c {
58 noncopyable c0;
59 a c1 = 43;
60 c() = default;
61 };
62
63 //--- d.cpp
64 // expected-no-diagnostics
65 import c;
66 void d() {
67 c _;
68 }