2011-11-16 13:16:30 +08:00
|
|
|
// RUN: rm -rf %t
|
2012-01-04 03:32:59 +08:00
|
|
|
// RUN: %clang_cc1 -fmodules -x objective-c -emit-module -fmodule-cache-path %t -fmodule-name=macros %S/Inputs/module.map
|
|
|
|
// RUN: %clang_cc1 -fmodules -x objective-c -verify -fmodule-cache-path %t %s
|
|
|
|
// RUN: %clang_cc1 -E -fmodules -x objective-c -fmodule-cache-path %t %s | FileCheck -check-prefix CHECK-PREPROCESSED %s
|
|
|
|
// FIXME: When we have a syntax for modules in C, use that.
|
2011-09-02 01:04:32 +08:00
|
|
|
|
2012-03-02 06:07:04 +08:00
|
|
|
@__experimental_modules_import macros;
|
2011-09-02 01:04:32 +08:00
|
|
|
|
|
|
|
#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
|
|
|
|
|
2011-09-15 07:13:09 +08:00
|
|
|
// CHECK-PREPROCESSED: double d
|
2011-09-02 01:04:32 +08:00
|
|
|
double d;
|
|
|
|
DOUBLE *dp = &d;
|
|
|
|
|
2012-01-04 03:48:16 +08:00
|
|
|
#__public_macro WIBBLE // expected-error{{no macro named 'WIBBLE'}}
|
2011-09-02 01:04:32 +08:00
|
|
|
|
2011-09-15 06:14:14 +08:00
|
|
|
void f() {
|
2011-09-15 07:13:09 +08:00
|
|
|
// CHECK-PREPROCESSED: int i = INTEGER;
|
2011-09-15 06:14:14 +08:00
|
|
|
int i = INTEGER; // the value was exported, the macro was not.
|
|
|
|
}
|