diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-02 18:30:45 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-02 18:30:45 +0000 |
commit | 570918821a8492048e6ab54955c9864bd6c3e952 (patch) | |
tree | f9d0d3f3478c298aaf51987483bbbbefe8e6631b /test/Modules/import-syntax.c | |
parent | f0c55418e2b09eaab37c820d3756cc1b4584d084 (diff) |
Diffstat (limited to 'test/Modules/import-syntax.c')
-rw-r--r-- | test/Modules/import-syntax.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/Modules/import-syntax.c b/test/Modules/import-syntax.c new file mode 100644 index 0000000000000..a29e07aa1c2be --- /dev/null +++ b/test/Modules/import-syntax.c @@ -0,0 +1,35 @@ +// RUN: rm -rf %t +// +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x c -DINCLUDE %s +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x objective-c -DINCLUDE %s +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x c++ -DINCLUDE %s +// +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x objective-c -DAT_IMPORT=1 %s +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x objective-c++ -DAT_IMPORT=1 %s +// +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x c++ -fmodules-ts -DIMPORT=1 %s +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x objective-c++ -fmodules-ts -DIMPORT=1 %s +// +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x c -DPRAGMA %s +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x objective-c -DPRAGMA %s +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x c++ -DPRAGMA %s + +// expected-no-diagnostics + +// All forms of module import should make both declarations and macros visible. + +#if INCLUDE +#include "dummy.h" +#elif AT_IMPORT +@import dummy; +#elif IMPORT +import dummy; +#elif PRAGMA +#pragma clang module import dummy +#endif + +#ifndef DUMMY_H +#error "macros not visible" +#endif + +void *p = &dummy1; |