Debian Codegraph @

clang/test/Modules/named-modules-adl.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 %t/a.cppm -emit-module-interface -o %t/a.pcm
6 // RUN: %clang_cc1 -std=c++20 %t/b.cppm -fmodule-file=a=%t/a.pcm -fsyntax-only -verify
7
8 // RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm -DREDUCED
9 // RUN: %clang_cc1 -std=c++20 %t/b.cppm -fmodule-file=a=%t/a.pcm -fsyntax-only -verify
10
11 //--- a.h
12 namespace n {
13
14 struct s { };
15
16 void operator+(s, int) {
17 }
18
19 } // namespace n
20
21 //--- a.cppm
22 module;
23 #include "a.h"
24 export module a;
25
26 export template<typename T>
27 void a(T x) {
28 n::s() + x;
29 }
30
31 #ifdef REDUCED
32 // Use it to make sure it is not optimized out in reduced BMI.
33 using n::operator+;
34 #endif
35
36 //--- b.cppm
37 // expected-no-diagnostics
38 export module b;
39 import a;
40
41 void b() {
42 a(0);
43 }