From 2a553089c30fc3cda435ffef90bc3d2976d531d1 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 23 Apr 2015 22:58:06 +0000 Subject: [modules] Properly attribute macros to modules if they're in a file textually included into a file in the module. llvm-svn: 235661 --- clang/test/Modules/Inputs/macros-indirect.h | 1 + clang/test/Modules/Inputs/macros.h | 1 + clang/test/Modules/macros.c | 4 ++++ 3 files changed, 6 insertions(+) create mode 100644 clang/test/Modules/Inputs/macros-indirect.h (limited to 'clang/test/Modules') diff --git a/clang/test/Modules/Inputs/macros-indirect.h b/clang/test/Modules/Inputs/macros-indirect.h new file mode 100644 index 00000000000..c90300e464f --- /dev/null +++ b/clang/test/Modules/Inputs/macros-indirect.h @@ -0,0 +1 @@ +#define INDIRECTLY_IN_MACROS 1 diff --git a/clang/test/Modules/Inputs/macros.h b/clang/test/Modules/Inputs/macros.h index 27f43c0626e..a0ae7a31582 100644 --- a/clang/test/Modules/Inputs/macros.h +++ b/clang/test/Modules/Inputs/macros.h @@ -17,3 +17,4 @@ int (INTEGER); extern int __MODULE__; #endif +#include "macros-indirect.h" diff --git a/clang/test/Modules/macros.c b/clang/test/Modules/macros.c index 92ea88a4802..3ca53005cf3 100644 --- a/clang/test/Modules/macros.c +++ b/clang/test/Modules/macros.c @@ -28,6 +28,10 @@ # error MODULE macro should not be visible #endif +#ifndef INDIRECTLY_IN_MACROS +# error INDIRECTLY_IN_MACROS should be visible +#endif + // CHECK-PREPROCESSED: double d double d; DOUBLE *dp = &d; -- cgit v1.2.3