30 lines · c
1// RUN: rm -rf %t2// RUN: split-file %s %t3// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/modules.cache \4// RUN: -fsyntax-only %t/test.c -verify5// Test again with the populated module cache.6// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/modules.cache \7// RUN: -fsyntax-only %t/test.c -verify8 9// Test that an identifier with the same name as a macro doesn't hide this10// macro from the includers.11 12//--- macro-definition.h13#define __P(protos) ()14#define __Q(protos) ()15 16//--- macro-transitive.h17#include "macro-definition.h"18void test(int __P) {} // not "interesting" identifier19struct __Q {}; // "interesting" identifier20 21//--- module.modulemap22module MacroDefinition { header "macro-definition.h" export * }23module MacroTransitive { header "macro-transitive.h" export * }24 25//--- test.c26// expected-no-diagnostics27#include "macro-transitive.h"28void foo __P(());29void bar __Q(());30