From 71129d5e9e3a290df21ef8f3389c1b54b10f62cd Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 17 Oct 2011 14:55:37 +0000 Subject: When building a module, use the macro definitions on the command line as part of the hash rather than ignoring them. This means we'll end up building more module variants (overall), but it allows configuration macros such as NDEBUG to work so long as they're specified via command line. More to come in this space. llvm-svn: 142187 --- clang/test/Modules/on-demand-macros.m | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 clang/test/Modules/on-demand-macros.m (limited to 'clang/test/Modules/on-demand-macros.m') diff --git a/clang/test/Modules/on-demand-macros.m b/clang/test/Modules/on-demand-macros.m new file mode 100644 index 00000000000..96abb2331f1 --- /dev/null +++ b/clang/test/Modules/on-demand-macros.m @@ -0,0 +1,13 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodule-cache-path %t -F %S/Inputs -DFOO_RETURNS_INT_PTR -verify %s +// RUN: %clang_cc1 -fmodule-cache-path %t -F %S/Inputs -verify %s + +__import_module__ CmdLine; + +void test() { +#ifdef FOO_RETURNS_INT_PTR + int *ip = foo(); +#else + float *fp = foo(); +#endif +} -- cgit v1.2.3