blob: 578e09fbda4f287b7de8bedb0afc59283a8ffc2b [file] [log] [blame]
Douglas Gregor7143aab2011-09-01 17:04:32 +00001// RUN: %clang_cc1 -emit-module -o %t/macros.pcm -DMODULE %s
Douglas Gregor6e975c42011-09-13 23:15:45 +00002// RUN: %clang_cc1 -verify -fmodule-cache-path %t -fdisable-module-hash %s
Douglas Gregor7143aab2011-09-01 17:04:32 +00003
4#if defined(MODULE)
5#define INTEGER(X) int
6#define FLOAT float
7#define DOUBLE double
8
9#__export_macro__ INTEGER
10#__export_macro__ DOUBLE
11
12#else
13
14__import_module__ macros;
15
16#ifndef INTEGER
17# error INTEGER macro should be visible
18#endif
19
20#ifdef FLOAT
21# error FLOAT macro should not be visible
22#endif
23
24#ifdef MODULE
25# error MODULE macro should not be visible
26#endif
27
28double d;
29DOUBLE *dp = &d;
30
31#__export_macro__ WIBBLE // expected-error{{no macro named 'WIBBLE' to export}}
32
33#endif