blob: 3fddcc7ff5d671601e625ee9b63f68c271b31b5d [file] [log] [blame]
Douglas Gregor42583322011-11-16 05:16:30 +00001// RUN: rm -rf %t
Douglas Gregorc13a34b2012-01-03 19:32:59 +00002// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-cache-path %t -fmodule-name=macros %S/Inputs/module.map
3// RUN: %clang_cc1 -fmodules -x objective-c -verify -fmodule-cache-path %t %s
4// RUN: %clang_cc1 -E -fmodules -x objective-c -fmodule-cache-path %t %s | FileCheck -check-prefix CHECK-PREPROCESSED %s
5// FIXME: When we have a syntax for modules in C, use that.
Douglas Gregor7143aab2011-09-01 17:04:32 +00006
Douglas Gregorc13a34b2012-01-03 19:32:59 +00007@import macros;
Douglas Gregor7143aab2011-09-01 17:04:32 +00008
9#ifndef INTEGER
10# error INTEGER macro should be visible
11#endif
12
13#ifdef FLOAT
14# error FLOAT macro should not be visible
15#endif
16
17#ifdef MODULE
18# error MODULE macro should not be visible
19#endif
20
Douglas Gregorde8a9052011-09-14 23:13:09 +000021// CHECK-PREPROCESSED: double d
Douglas Gregor7143aab2011-09-01 17:04:32 +000022double d;
23DOUBLE *dp = &d;
24
Douglas Gregor94ad28b2012-01-03 18:24:14 +000025#public WIBBLE // expected-error{{no macro named 'WIBBLE'}}
Douglas Gregor7143aab2011-09-01 17:04:32 +000026
Douglas Gregorce835df2011-09-14 22:14:14 +000027void f() {
Douglas Gregorde8a9052011-09-14 23:13:09 +000028 // CHECK-PREPROCESSED: int i = INTEGER;
Douglas Gregorce835df2011-09-14 22:14:14 +000029 int i = INTEGER; // the value was exported, the macro was not.
30}