blob: 460c482ef9cfdd1947bb12ed301e0e61caca6e5a [file] [log] [blame]
Douglas Gregor42583322011-11-16 05:16:30 +00001// RUN: rm -rf %t
Douglas Gregor94ad28b2012-01-03 18:24:14 +00002// RUN: %clang_cc1 -fmodules -emit-module -fmodule-cache-path %t -fmodule-name=macros %S/Inputs/module.map
3// RUN: %clang_cc1 -fmodules -verify -fmodule-cache-path %t %s
4// RUN: %clang_cc1 -E -fmodules -fmodule-cache-path %t %s | FileCheck -check-prefix CHECK-PREPROCESSED %s
Douglas Gregor7143aab2011-09-01 17:04:32 +00005
6__import_module__ macros;
7
8#ifndef INTEGER
9# error INTEGER macro should be visible
10#endif
11
12#ifdef FLOAT
13# error FLOAT macro should not be visible
14#endif
15
16#ifdef MODULE
17# error MODULE macro should not be visible
18#endif
19
Douglas Gregorde8a9052011-09-14 23:13:09 +000020// CHECK-PREPROCESSED: double d
Douglas Gregor7143aab2011-09-01 17:04:32 +000021double d;
22DOUBLE *dp = &d;
23
Douglas Gregor94ad28b2012-01-03 18:24:14 +000024#public WIBBLE // expected-error{{no macro named 'WIBBLE'}}
Douglas Gregor7143aab2011-09-01 17:04:32 +000025
Douglas Gregorce835df2011-09-14 22:14:14 +000026void f() {
Douglas Gregorde8a9052011-09-14 23:13:09 +000027 // CHECK-PREPROCESSED: int i = INTEGER;
Douglas Gregorce835df2011-09-14 22:14:14 +000028 int i = INTEGER; // the value was exported, the macro was not.
29}