Richard Smith | ea74148 | 2017-05-01 22:10:47 +0000 | [diff] [blame^] | 1 | // RUN: rm -rf %t |
| 2 | // |
| 3 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -emit-module -fmodules-cache-path=%t -fmodule-name=diag_flags -x c++ %S/Inputs/module.map -fmodules-ts |
| 4 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -fmodules-ts |
| 5 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -fmodules-ts -DIMPLICIT_FLAG -Werror=padded |
| 6 | // |
| 7 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -emit-module -fmodule-name=diag_flags -x c++ %S/Inputs/module.map -fmodules-ts -o %t/explicit.pcm -Werror=string-plus-int -Wpadded |
| 8 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -fmodules-ts -DEXPLICIT_FLAG -fmodule-file=%t/explicit.pcm |
| 9 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -I %S/Inputs %s -fmodules-ts -DEXPLICIT_FLAG -fmodule-file=%t/explicit.pcm -Werror=padded |
| 10 | |
| 11 | import diag_flags; |
| 12 | |
| 13 | // Diagnostic flags from the module user make no difference to diagnostics |
| 14 | // emitted within the module when using an explicitly-loaded module. |
| 15 | #ifdef IMPLICIT_FLAG |
| 16 | // expected-error@diag_flags.h:14 {{padding struct}} |
| 17 | #elif defined(EXPLICIT_FLAG) |
| 18 | // expected-warning@diag_flags.h:14 {{padding struct}} |
| 19 | #else |
| 20 | // expected-no-diagnostics |
| 21 | #endif |
| 22 | unsigned n = sizeof(Padded); |