Debian Codegraph @

clang/test/Modules/pr127943.cppm

raw
1 // RUN: rm -rf %t
2 // RUN: mkdir -p %t
3 // RUN: split-file %s %t
4 //
5 // RUN: %clang_cc1 -std=c++20 %t/repro.cppm -fdeclspec -emit-module-interface -o %t/repro.pcm
6 // RUN: %clang_cc1 -std=c++20 %t/source.cpp -fdeclspec -fsyntax-only -verify -fprebuilt-module-path=%t
7
8 //--- repro_decl.hpp
9 #pragma once
10
11 extern "C"
12 {
13 __declspec(selectany) int foo = 0;
14 }
15
16 //--- repro.cppm
17 module;
18 #include "repro_decl.hpp"
19
20 export module repro;
21
22 export inline int func()
23 {
24 return foo;
25 }
26
27 //--- source.cpp
28 // expected-no-diagnostics
29 import repro;
30
31 #include "repro_decl.hpp"