Chuanqi Xu d2639ffff2 [NFC] [C++20] [Modules] Add test for #pragma once
Close https://github.com/llvm/llvm-project/issues/38554
Close https://github.com/llvm/llvm-project/issues/58532

It looks like we can workaround the '#pragma once' problem automatically
after we force the lazily loading for named modules. Add a test to show
this.
2023-03-20 11:37:09 +08:00

22 lines
318 B
C++

// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %t/c.cppm
//--- a.hpp
#pragma once
using a = int;
//--- b.hpp
#pragma once
#include "a.hpp"
a b;
//--- c.cppm
// expected-no-diagnostics
module;
#include "b.hpp"
export module c;
export using ::a;