brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · c961260 Raw
33 lines · plain
1@import HasWarnings;2 3#ifdef WITH_ERRORS4@import HasErrors;5#endif6 7float float_val;8double *double_ptr = &float_val;9 10// RUN: rm -rf %t %t.diag %t.out11// RUN: %clang -Wno-error=incompatible-pointer-types -fmodules -fmodules-cache-path=%t/ModuleCache -I %S/Inputs/ModuleDiags -fsyntax-only %s --serialize-diagnostics %t.diag > /dev/null 2>&112// RUN: c-index-test -read-diagnostics %t.diag > %t.out 2>&113// RUN: FileCheck --input-file=%t.out %s14 15// CHECK: has_warnings.h:3:8: warning: incompatible pointer types initializing 'float *'16// CHECK: serialized-diags.m:1:9: note: while building module 'HasWarnings' imported from17// CHECK: serialized-diags.m:8:9: warning: incompatible pointer types initializing 'double *'18// CHECK: Number of diagnostics: 219 20// RUN: rm -rf %t %t.diag_errors %t.out_errors21// RUN: not %clang -Wno-error=incompatible-pointer-types -fmodules -fmodules-cache-path=%t/ModuleCache -I %S/Inputs/ModuleDiags -fsyntax-only -DWITH_ERRORS %s --serialize-diagnostics %t.diag_errors > /dev/null 2>&122// RUN: c-index-test -read-diagnostics %t.diag_errors > %t.out_errors 2>&123// RUN: FileCheck -check-prefix=CHECK-WITH-ERRORS --input-file=%t.out_errors %s24 25// CHECK-WITH-ERRORS: has_warnings.h:3:8: warning: incompatible pointer types initializing 'float *'26// CHECK-WITH-ERRORS: serialized-diags.m:1:9: note: while building module 'HasWarnings'27// CHECK-WITH-ERRORS: has_errors.h:2:13: error: redefinition of 'foo'28// CHECK-WITH-ERRORS: serialized-diags.m:4:9: note: while building module 'HasErrors'29// CHECK-WITH-ERRORS: has_errors.h:1:13: note: previous definition is here30// CHECK-WITH-ERRORS: serialized-diags.m:4:9: fatal: could not build module 'HasErrors'31// CHECK-WITH-ERRORS: Number of diagnostics: 332 33