Ben Langmuir | b92de02 | 2014-04-29 16:25:26 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
| 2 | // RUN: rm -rf %t-saved |
| 3 | // RUN: mkdir -p %t-saved |
| 4 | |
| 5 | // Initial module build (-Werror=header-guard) |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 6 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \ |
Ben Langmuir | b92de02 | 2014-04-29 16:25:26 +0000 | [diff] [blame] | 7 | // RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \ |
| 8 | // RUN: -Werror=header-guard |
| 9 | // RUN: cp %t/Module.pcm %t-saved/Module.pcm |
| 10 | |
| 11 | // Building with looser -Werror options does not rebuild |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 12 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \ |
Ben Langmuir | b92de02 | 2014-04-29 16:25:26 +0000 | [diff] [blame] | 13 | // RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella |
| 14 | // RUN: diff %t/Module.pcm %t-saved/Module.pcm |
| 15 | |
| 16 | // Make the build more restricted (-Werror) |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 17 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \ |
Ben Langmuir | b92de02 | 2014-04-29 16:25:26 +0000 | [diff] [blame] | 18 | // RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \ |
| 19 | // RUN: -Werror -Wno-incomplete-umbrella |
| 20 | // RUN: not diff %t/Module.pcm %t-saved/Module.pcm |
| 21 | // RUN: cp %t/Module.pcm %t-saved/Module.pcm |
| 22 | |
| 23 | // Ensure -Werror=header-guard is less strict than -Werror |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 24 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \ |
Ben Langmuir | b92de02 | 2014-04-29 16:25:26 +0000 | [diff] [blame] | 25 | // RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \ |
| 26 | // RUN: -Werror=header-guard -Wno-incomplete-umbrella |
| 27 | // RUN: diff %t/Module.pcm %t-saved/Module.pcm |
| 28 | |
| 29 | // But -Werror=unused is not, because some of its diags are DefaultIgnore |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 30 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \ |
Ben Langmuir | b92de02 | 2014-04-29 16:25:26 +0000 | [diff] [blame] | 31 | // RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \ |
| 32 | // RUN: -Werror=unused |
| 33 | // RUN: not diff %t/Module.pcm %t-saved/Module.pcm |
| 34 | // RUN: cp %t/Module.pcm %t-saved/Module.pcm |
| 35 | |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 36 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \ |
Ben Langmuir | b92de02 | 2014-04-29 16:25:26 +0000 | [diff] [blame] | 37 | // RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \ |
| 38 | // RUN: -Werror -Wno-incomplete-umbrella |
| 39 | |
| 40 | // FIXME: when rebuilding the module, take the union of the diagnostic options |
| 41 | // so that we don't need to rebuild here |
| 42 | // RUN-DISABLED: diff %t/Module.pcm %t-saved/Module.pcm |
| 43 | |
| 44 | // -Wno-everything, -Werror |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 45 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \ |
Ben Langmuir | b92de02 | 2014-04-29 16:25:26 +0000 | [diff] [blame] | 46 | // RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \ |
| 47 | // RUN: -Wno-everything -Wall -Werror |
| 48 | // RUN: cp %t/Module.pcm %t-saved/Module.pcm |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 49 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \ |
Ben Langmuir | b92de02 | 2014-04-29 16:25:26 +0000 | [diff] [blame] | 50 | // RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \ |
| 51 | // RUN: -Wall -Werror |
| 52 | // RUN: not diff %t/Module.pcm %t-saved/Module.pcm |
| 53 | |
| 54 | // -pedantic, -Werror is not compatible with -Wall -Werror |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 55 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \ |
Ben Langmuir | b92de02 | 2014-04-29 16:25:26 +0000 | [diff] [blame] | 56 | // RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \ |
| 57 | // RUN: -Werror -pedantic |
| 58 | // RUN: not diff %t/Module.pcm %t-saved/Module.pcm |
| 59 | // RUN: cp %t/Module.pcm %t-saved/Module.pcm |
| 60 | |
| 61 | // -pedantic-errors is less strict that -pedantic, -Werror |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 62 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \ |
Ben Langmuir | b92de02 | 2014-04-29 16:25:26 +0000 | [diff] [blame] | 63 | // RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \ |
| 64 | // RUN: -pedantic-errors |
| 65 | // RUN: diff %t/Module.pcm %t-saved/Module.pcm |
| 66 | |
| 67 | // -Wsystem-headers does not affect non-system modules |
Richard Smith | 47972af | 2015-06-16 00:08:24 +0000 | [diff] [blame] | 68 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \ |
Ben Langmuir | b92de02 | 2014-04-29 16:25:26 +0000 | [diff] [blame] | 69 | // RUN: -F %S/Inputs -fsyntax-only %s -verify -Wno-incomplete-umbrella \ |
| 70 | // RUN: -pedantic-errors -Wsystem-headers |
| 71 | // RUN: diff %t/Module.pcm %t-saved/Module.pcm |
| 72 | |
| 73 | // expected-no-diagnostics |
| 74 | @import Module; |