diff options
author | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
commit | c72c57c9e9b69944e3e009cd5e209634839581d3 (patch) | |
tree | 4fc2f184c499d106f29a386c452b49e5197bf63d /test/Modules/config_macros.m | |
parent | 5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff) | |
download | FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz |
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
Diffstat (limited to 'test/Modules/config_macros.m')
-rw-r--r-- | test/Modules/config_macros.m | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/Modules/config_macros.m b/test/Modules/config_macros.m new file mode 100644 index 0000000..200744d --- /dev/null +++ b/test/Modules/config_macros.m @@ -0,0 +1,28 @@ +@import config; + +int *test_foo() { + return foo(); +} + +char *test_bar() { + return bar(); // expected-warning{{implicit declaration of function 'bar' is invalid in C99}} \ + // expected-warning{{incompatible integer to pointer conversion}} +} + +#undef WANT_FOO // expected-note{{macro was #undef'd here}} +@import config; // expected-warning{{#undef of configuration macro 'WANT_FOO' has no effect on the import of 'config'; pass '-UWANT_FOO' on the command line to configure the module}} + +#define WANT_FOO 2 // expected-note{{macro was defined here}} +@import config; // expected-warning{{definition of configuration macro 'WANT_FOO' has no effect on the import of 'config'; pass '-DWANT_FOO=...' on the command line to configure the module}} + +#undef WANT_FOO +#define WANT_FOO 1 +@import config; // okay + +#define WANT_BAR 1 // expected-note{{macro was defined here}} +@import config; // expected-warning{{definition of configuration macro 'WANT_BAR' has no effect on the import of 'config'; pass '-DWANT_BAR=...' on the command line to configure the module}} + +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules -x objective-c -fmodules-cache-path=%t -DWANT_FOO=1 -emit-module -fmodule-name=config %S/Inputs/module.map +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -DWANT_FOO=1 %s -verify + |