Debian Codegraph @

clang/test/Modules/external-but-not-type-external.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 -triple %itanium_abi_triple %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
6 // RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/use.cc -fmodule-file=a=%t/a.pcm -fsyntax-only -verify
7 // RUN: %clang_cc1 -std=c++20 -triple %itanium_abi_triple %t/use.cc -fmodule-file=a=%t/a.pcm -emit-llvm -o - | \
8 // RUN: FileCheck %t/use.cc
9
10 //--- a.cppm
11 export module a;
12 namespace {
13 struct Local {};
14 }
15
16 export class A {
17 public:
18 void *external_but_not_type_external(Local *) {
19 return nullptr;
20 }
21 };
22
23 //--- use.cc
24 // expected-no-diagnostics
25 import a;
26 void *use() {
27 A a;
28 return a.external_but_not_type_external(nullptr);
29 }
30
31 // CHECK: define {{.*}}internal {{.*}}@_ZNW1a1A30external_but_not_type_externalEPN12_GLOBAL__N_15LocalE