Douglas Gregor | 4258332 | 2011-11-16 05:16:30 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
Douglas Gregor | 94ad28b | 2012-01-03 18:24:14 +0000 | [diff] [blame] | 2 | // 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 Gregor | 7143aab | 2011-09-01 17:04:32 +0000 | [diff] [blame] | 5 | |
| 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 Gregor | de8a905 | 2011-09-14 23:13:09 +0000 | [diff] [blame] | 20 | // CHECK-PREPROCESSED: double d |
Douglas Gregor | 7143aab | 2011-09-01 17:04:32 +0000 | [diff] [blame] | 21 | double d; |
| 22 | DOUBLE *dp = &d; |
| 23 | |
Douglas Gregor | 94ad28b | 2012-01-03 18:24:14 +0000 | [diff] [blame] | 24 | #public WIBBLE // expected-error{{no macro named 'WIBBLE'}} |
Douglas Gregor | 7143aab | 2011-09-01 17:04:32 +0000 | [diff] [blame] | 25 | |
Douglas Gregor | ce835df | 2011-09-14 22:14:14 +0000 | [diff] [blame] | 26 | void f() { |
Douglas Gregor | de8a905 | 2011-09-14 23:13:09 +0000 | [diff] [blame] | 27 | // CHECK-PREPROCESSED: int i = INTEGER; |
Douglas Gregor | ce835df | 2011-09-14 22:14:14 +0000 | [diff] [blame] | 28 | int i = INTEGER; // the value was exported, the macro was not. |
| 29 | } |