llvm-project/clang/test/Headers/import_header_unit_after_pragma.cpp
Dmitry Polukhin 65780f4d8e
[C++20][Modules] Allow import for a header unit after #pragma (#111662)
Summary:
`#pragma` and headers that finish with them shouldn't prevent `import
"header_unit.h"` syntax.

Test Plan: check-clang
2024-10-11 08:23:35 +01:00

19 lines
515 B
C++

// RUN: rm -fR %t
// RUN: split-file %s %t
// RUN: cd %t
// RUN: %clang_cc1 -verify -std=c++20 -emit-header-unit -xc++-user-header bz0.h
// RUN: %clang_cc1 -verify -std=c++20 -emit-header-unit -xc++-user-header -fmodule-file=bz0.pcm bz.cpp
//--- compare
#pragma GCC visibility push(default)
#pragma GCC visibility pop
//--- bz0.h
#include "compare"
// expected-no-diagnostics
//--- bz.cpp
#include "compare"
import "bz0.h"; // expected-warning {{the implementation of header units is in an experimental phase}}