diff options
Diffstat (limited to 'test/Modules')
-rw-r--r-- | test/Modules/Inputs/CmdLine.framework/Headers/CmdLine.h | 6 | ||||
-rw-r--r-- | test/Modules/on-demand-build-warnings.m | 2 | ||||
-rw-r--r-- | test/Modules/on-demand-build.m | 8 | ||||
-rw-r--r-- | test/Modules/on-demand-macros.m | 13 |
4 files changed, 24 insertions, 5 deletions
diff --git a/test/Modules/Inputs/CmdLine.framework/Headers/CmdLine.h b/test/Modules/Inputs/CmdLine.framework/Headers/CmdLine.h new file mode 100644 index 0000000000..46b8fc0425 --- /dev/null +++ b/test/Modules/Inputs/CmdLine.framework/Headers/CmdLine.h @@ -0,0 +1,6 @@ +#ifdef FOO_RETURNS_INT_PTR +int *foo(void); +#else +float *foo(void); +#endif + diff --git a/test/Modules/on-demand-build-warnings.m b/test/Modules/on-demand-build-warnings.m index ea531698cf..aa122dbd85 100644 --- a/test/Modules/on-demand-build-warnings.m +++ b/test/Modules/on-demand-build-warnings.m @@ -1,5 +1,5 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Wmodule-build -fmodule-cache-path %t -F %S/Inputs -DFOO -verify %s +// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Wmodule-build -fmodule-cache-path %t -F %S/Inputs -verify %s __import_module__ Module; // expected-warning{{building module 'Module' from source}} diff --git a/test/Modules/on-demand-build.m b/test/Modules/on-demand-build.m index 418e912f63..649caa8a7d 100644 --- a/test/Modules/on-demand-build.m +++ b/test/Modules/on-demand-build.m @@ -1,8 +1,8 @@ // RUN: rm -rf %t -// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -fmodule-cache-path %t -F %S/Inputs -DFOO -verify %s -// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -x objective-c++ -fmodule-cache-path %t -F %S/Inputs -DFOO -verify %s -// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -fmodule-cache-path %t -F %S/Inputs -DFOO -verify %s - +// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -fmodule-cache-path %t -F %S/Inputs -verify %s +// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -x objective-c++ -fmodule-cache-path %t -F %S/Inputs -verify %s +// RUN: %clang_cc1 -fno-objc-infer-related-result-type -Werror -fmodule-cache-path %t -F %S/Inputs -verify %s +#define FOO __import_module__ Module; @interface OtherClass @end diff --git a/test/Modules/on-demand-macros.m b/test/Modules/on-demand-macros.m new file mode 100644 index 0000000000..96abb2331f --- /dev/null +++ b/test/Modules/on-demand-macros.m @@ -0,0 +1,13 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodule-cache-path %t -F %S/Inputs -DFOO_RETURNS_INT_PTR -verify %s +// RUN: %clang_cc1 -fmodule-cache-path %t -F %S/Inputs -verify %s + +__import_module__ CmdLine; + +void test() { +#ifdef FOO_RETURNS_INT_PTR + int *ip = foo(); +#else + float *fp = foo(); +#endif +} |