aboutsummaryrefslogtreecommitdiff
path: root/test/Modules/macros.c
blob: 691e8ec0ec1843e60650c5c3ec55ddd4fa1d15d4 (plain)
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
30
31
32
33
// RUN: %clang_cc1 -emit-module -o %t/macros.pcm -DMODULE %s
// RUN: %clang_cc1 -verify -I %t %s

#if defined(MODULE)
#define INTEGER(X) int
#define FLOAT float
#define DOUBLE double

#__export_macro__ INTEGER
#__export_macro__ DOUBLE

#else

__import_module__ macros;

#ifndef INTEGER
#  error INTEGER macro should be visible
#endif

#ifdef FLOAT
#  error FLOAT macro should not be visible
#endif

#ifdef MODULE
#  error MODULE macro should not be visible
#endif

double d;
DOUBLE *dp = &d;

#__export_macro__ WIBBLE // expected-error{{no macro named 'WIBBLE' to export}}

#endif