Add PR check to suggest alternatives to using undef (#118506)
[llvm-project.git] / clang / test / Modules / pch-with-module-name-import-twice.c
blob67932a4ba46aa6349066dac85b2f08296f1647d2
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
4 // This test checks that headers that are part of a module named by
5 // -fmodule-name= don't get included again if previously included from a PCH.
7 //--- include/module.modulemap
8 module Mod { header "Mod.h" }
9 //--- include/Mod.h
10 struct Symbol {};
11 //--- pch.h
12 #import "Mod.h"
13 //--- tu.c
14 #import "Mod.h" // expected-no-diagnostics
16 // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t/cache -fimplicit-module-maps -fmodule-name=Mod -I %t/include \
17 // RUN: -emit-pch -x c-header %t/pch.h -o %t/pch.pch
18 // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t/cache -fimplicit-module-maps -fmodule-name=Mod -I %t/include \
19 // RUN: -fsyntax-only %t/tu.c -include-pch %t/pch.pch -verify