1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
// RUN: rm -rf %t
// RUN: split-file %s %t
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/modules.cache \
// RUN: -fsyntax-only %t/test.c -verify
// Test again with the populated module cache.
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/modules.cache \
// RUN: -fsyntax-only %t/test.c -verify
// Test that an identifier with the same name as a macro doesn't hide this
// macro from the includers.
//--- macro-definition.h
#define __P(protos) ()
#define __Q(protos) ()
//--- macro-transitive.h
#include "macro-definition.h"
void test(int __P) {} // not "interesting" identifier
struct __Q {}; // "interesting" identifier
//--- module.modulemap
module MacroDefinition { header "macro-definition.h" export * }
module MacroTransitive { header "macro-transitive.h" export * }
//--- test.c
// expected-no-diagnostics
#include "macro-transitive.h"
void foo __P(());
void bar __Q(());
|