Haojian Wu 1d0ee12e34
Reland "Reland [Modules] Remove unnecessary check when generating name lookup table in ASTWriter" (#139253)
This relands the patch
67b298f6d8,
with some more testcases.

The `undefined symbol` error mentioned in
https://github.com/llvm/llvm-project/issues/61065#issuecomment-1517725811
doesn't exist anymore from our internal tests.

Fixes #61065, #134739

---------

Co-authored-by: Viktoriia Bakalova <bakalova@google.com>
2025-05-13 07:46:43 +02:00

69 lines
1.5 KiB
C++

// From https://github.com/llvm/llvm-project/issues/61065
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-module-interface -o %t/b.pcm \
// RUN: -fprebuilt-module-path=%t
// RUN: %clang_cc1 -std=c++20 %t/c.cppm -emit-module-interface -o %t/c.pcm \
// RUN: -fprebuilt-module-path=%t
// RUN: %clang_cc1 -std=c++20 %t/d.cpp -fsyntax-only -verify -fprebuilt-module-path=%t
// Test again with reduced BMI
// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-reduced-module-interface -o %t/b.pcm \
// RUN: -fprebuilt-module-path=%t
// RUN: %clang_cc1 -std=c++20 %t/c.cppm -emit-reduced-module-interface -o %t/c.pcm \
// RUN: -fprebuilt-module-path=%t
// RUN: %clang_cc1 -std=c++20 %t/d.cpp -fsyntax-only -verify -fprebuilt-module-path=%t
//--- a.cppm
export module a;
struct base {
base(int) {}
};
export struct a : base {
using base::base;
};
//--- b.cppm
export module b;
import a;
a b() {
return a(1);
}
//--- c.cppm
export module c;
import a;
import b;
struct noncopyable {
noncopyable(noncopyable const &) = delete;
noncopyable() = default;
};
export struct c {
noncopyable c0;
a c1 = 43;
c() = default;
};
//--- d.cpp
// expected-no-diagnostics
import c;
void d() {
c _;
}