blob: 346f91f22154f7e3c9554cdb831c831c69091878 [file] [log] [blame]
Douglas Gregor7143aab2011-09-01 17:04:32 +00001// RUN: %clang_cc1 -emit-module -o %t/macros.pcm -DMODULE %s
Douglas Gregor9a6da692011-09-12 20:41:59 +00002// RUN: %clang_cc1 -verify -fmodule-cache-path %t %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