macros.c revision 42583320cf7977fd474572b9fe78e13eaf45fb8f
142583320cf7977fd474572b9fe78e13eaf45fb8fDouglas Gregor// RUN: rm -rf %t
242583320cf7977fd474572b9fe78e13eaf45fb8fDouglas Gregor// RUN: %clang_cc1 -emit-module-from-map -fmodule-cache-path %t -fmodule-name=macros %S/Inputs/module.map
342583320cf7977fd474572b9fe78e13eaf45fb8fDouglas Gregor// RUN: %clang_cc1 -verify -fmodule-cache-path %t %s
442583320cf7977fd474572b9fe78e13eaf45fb8fDouglas Gregor// RUN: %clang_cc1 -E -fmodule-cache-path %t %s | FileCheck -check-prefix CHECK-PREPROCESSED %s
57143aab97c6e849a5a5005b7853b8c7d5af008edDouglas Gregor
67143aab97c6e849a5a5005b7853b8c7d5af008edDouglas Gregor__import_module__ macros;
77143aab97c6e849a5a5005b7853b8c7d5af008edDouglas Gregor
87143aab97c6e849a5a5005b7853b8c7d5af008edDouglas Gregor#ifndef INTEGER
97143aab97c6e849a5a5005b7853b8c7d5af008edDouglas Gregor#  error INTEGER macro should be visible
107143aab97c6e849a5a5005b7853b8c7d5af008edDouglas Gregor#endif
117143aab97c6e849a5a5005b7853b8c7d5af008edDouglas Gregor
127143aab97c6e849a5a5005b7853b8c7d5af008edDouglas Gregor#ifdef FLOAT
137143aab97c6e849a5a5005b7853b8c7d5af008edDouglas Gregor#  error FLOAT macro should not be visible
147143aab97c6e849a5a5005b7853b8c7d5af008edDouglas Gregor#endif
157143aab97c6e849a5a5005b7853b8c7d5af008edDouglas Gregor
167143aab97c6e849a5a5005b7853b8c7d5af008edDouglas Gregor#ifdef MODULE
177143aab97c6e849a5a5005b7853b8c7d5af008edDouglas Gregor#  error MODULE macro should not be visible
187143aab97c6e849a5a5005b7853b8c7d5af008edDouglas Gregor#endif
197143aab97c6e849a5a5005b7853b8c7d5af008edDouglas Gregor
20de8a9050d79d66325a18168a0994fed125a7790dDouglas Gregor// CHECK-PREPROCESSED: double d
217143aab97c6e849a5a5005b7853b8c7d5af008edDouglas Gregordouble d;
227143aab97c6e849a5a5005b7853b8c7d5af008edDouglas GregorDOUBLE *dp = &d;
237143aab97c6e849a5a5005b7853b8c7d5af008edDouglas Gregor
247143aab97c6e849a5a5005b7853b8c7d5af008edDouglas Gregor#__export_macro__ WIBBLE // expected-error{{no macro named 'WIBBLE' to export}}
257143aab97c6e849a5a5005b7853b8c7d5af008edDouglas Gregor
26ce835df9301d5bee7fc2c70344e05541f21a5ddaDouglas Gregorvoid f() {
27de8a9050d79d66325a18168a0994fed125a7790dDouglas Gregor  // CHECK-PREPROCESSED: int i = INTEGER;
28ce835df9301d5bee7fc2c70344e05541f21a5ddaDouglas Gregor  int i = INTEGER; // the value was exported, the macro was not.
29ce835df9301d5bee7fc2c70344e05541f21a5ddaDouglas Gregor}
30