|
| 1 | +// ============================================================================= |
| 2 | +// All checks on |
| 3 | +// ============================================================================= |
| 4 | + |
| 5 | +// RUN: %clang_cc1 -fbounds-safety -fbounds-safety-bringup-missing-checks=all -fsyntax-only %s -verify=all |
| 6 | + |
| 7 | +// all-no-diagnostics |
| 8 | + |
| 9 | +// ============================================================================= |
| 10 | +// batch_0 on |
| 11 | +// ============================================================================= |
| 12 | + |
| 13 | +// RUN: %clang_cc1 -fbounds-safety -fsyntax-only %s -verify=batch_0 |
| 14 | +// RUN: %clang_cc1 -fbounds-safety -fbounds-safety-bringup-missing-checks=batch_0 -fsyntax-only %s -verify=batch_0 |
| 15 | + |
| 16 | +// batch_0-no-diagnostics |
| 17 | + |
| 18 | +// ============================================================================= |
| 19 | +// All checks off |
| 20 | +// ============================================================================= |
| 21 | + |
| 22 | +// RUN: %clang_cc1 -fbounds-safety -fno-bounds-safety-bringup-missing-checks=all -fsyntax-only %s -verify=none |
| 23 | + |
| 24 | +// none-warning@*{{compiling with legacy -fbounds-safety bounds checks is deprecated; compile with -fbounds-safety-bringup-missing-checks=batch_0 to use the new bound checks}} |
| 25 | + |
| 26 | + |
| 27 | +// ============================================================================= |
| 28 | +// one check off |
| 29 | +// ============================================================================= |
| 30 | + |
| 31 | +// RUN: %clang_cc1 -fbounds-safety -fbounds-safety-bringup-missing-checks=all -fno-bounds-safety-bringup-missing-checks=access_size -fsyntax-only %s -verify=as-off |
| 32 | +// as-off-warning@*{{compiling with "access_size" bounds check disabled is deprecated; compile with -fbounds-safety-bringup-missing-checks=batch_0 to enable the new bound checks}} |
| 33 | + |
| 34 | +// RUN: %clang_cc1 -fbounds-safety -fbounds-safety-bringup-missing-checks=all -fno-bounds-safety-bringup-missing-checks=indirect_count_update -fsyntax-only %s -verify=icu-off |
| 35 | +// icu-off-warning@*{{compiling with "indirect_count_update" bounds check disabled is deprecated; compile with -fbounds-safety-bringup-missing-checks=batch_0 to enable the new bound checks}} |
| 36 | + |
| 37 | +// RUN: %clang_cc1 -fbounds-safety -fbounds-safety-bringup-missing-checks=all -fno-bounds-safety-bringup-missing-checks=return_size -fsyntax-only %s -verify=rs-off |
| 38 | +// rs-off-warning@*{{compiling with "return_size" bounds check disabled is deprecated; compile with -fbounds-safety-bringup-missing-checks=batch_0 to enable the new bound checks}} |
| 39 | + |
| 40 | +// RUN: %clang_cc1 -fbounds-safety -fbounds-safety-bringup-missing-checks=all -fno-bounds-safety-bringup-missing-checks=ended_by_lower_bound -fsyntax-only %s -verify=eblb-off |
| 41 | +// eblb-off-warning@*{{compiling with "ended_by_lower_bound" bounds check disabled is deprecated; compile with -fbounds-safety-bringup-missing-checks=batch_0 to enable the new bound checks}} |
| 42 | + |
| 43 | +// RUN: %clang_cc1 -fbounds-safety -fbounds-safety-bringup-missing-checks=all -fno-bounds-safety-bringup-missing-checks=compound_literal_init -fsyntax-only %s -verify=cli-off |
| 44 | +// cli-off-warning@*{{compiling with "compound_literal_init" bounds check disabled is deprecated; compile with -fbounds-safety-bringup-missing-checks=batch_0 to enable the new bound checks}} |
| 45 | + |
| 46 | +// RUN: %clang_cc1 -fbounds-safety -fbounds-safety-bringup-missing-checks=all -fno-bounds-safety-bringup-missing-checks=libc_attributes -fsyntax-only %s -verify=libca-off |
| 47 | +// libca-off-warning@*{{compiling with "libc_attributes" bounds check disabled is deprecated; compile with -fbounds-safety-bringup-missing-checks=batch_0 to enable the new bound checks}} |
| 48 | + |
| 49 | +// RUN: %clang_cc1 -fbounds-safety -fbounds-safety-bringup-missing-checks=all -fno-bounds-safety-bringup-missing-checks=array_subscript_agg -fsyntax-only %s -verify=asa-off |
| 50 | +// asa-off-warning@*{{compiling with "array_subscript_agg" bounds check disabled is deprecated; compile with -fbounds-safety-bringup-missing-checks=batch_0 to enable the new bound checks}} |
| 51 | + |
| 52 | +// ============================================================================= |
| 53 | +// two checks off |
| 54 | +// ============================================================================= |
| 55 | + |
| 56 | +// Don't be exhaustive to keep this test case smaller |
| 57 | + |
| 58 | +// RUN: %clang_cc1 -fbounds-safety -fbounds-safety-bringup-missing-checks=all \ |
| 59 | +// RUN: -fno-bounds-safety-bringup-missing-checks=access_size \ |
| 60 | +// RUN: -fno-bounds-safety-bringup-missing-checks=indirect_count_update \ |
| 61 | +// RUN: -fsyntax-only %s -verify=as-off,icu-off |
| 62 | + |
| 63 | +// RUN: %clang_cc1 -fbounds-safety -fbounds-safety-bringup-missing-checks=all \ |
| 64 | +// RUN: -fno-bounds-safety-bringup-missing-checks=access_size \ |
| 65 | +// RUN: -fno-bounds-safety-bringup-missing-checks=return_size \ |
| 66 | +// RUN: -fsyntax-only %s -verify=as-off,rs-off |
| 67 | + |
| 68 | +// RUN: %clang_cc1 -fbounds-safety -fbounds-safety-bringup-missing-checks=all \ |
| 69 | +// RUN: -fno-bounds-safety-bringup-missing-checks=access_size \ |
| 70 | +// RUN: -fno-bounds-safety-bringup-missing-checks=ended_by_lower_bound \ |
| 71 | +// RUN: -fsyntax-only %s -verify=as-off,eblb-off |
| 72 | + |
| 73 | +// RUN: %clang_cc1 -fbounds-safety -fbounds-safety-bringup-missing-checks=all \ |
| 74 | +// RUN: -fno-bounds-safety-bringup-missing-checks=access_size \ |
| 75 | +// RUN: -fno-bounds-safety-bringup-missing-checks=compound_literal_init \ |
| 76 | +// RUN: -fsyntax-only %s -verify=as-off,cli-off |
| 77 | + |
| 78 | +// RUN: %clang_cc1 -fbounds-safety -fbounds-safety-bringup-missing-checks=all \ |
| 79 | +// RUN: -fno-bounds-safety-bringup-missing-checks=access_size \ |
| 80 | +// RUN: -fno-bounds-safety-bringup-missing-checks=libc_attributes \ |
| 81 | +// RUN: -fsyntax-only %s -verify=as-off,libca-off |
| 82 | + |
| 83 | +// RUN: %clang_cc1 -fbounds-safety -fbounds-safety-bringup-missing-checks=all \ |
| 84 | +// RUN: -fno-bounds-safety-bringup-missing-checks=access_size \ |
| 85 | +// RUN: -fno-bounds-safety-bringup-missing-checks=array_subscript_agg \ |
| 86 | +// RUN: -fsyntax-only %s -verify=as-off,asa-off |
| 87 | + |
| 88 | + |
| 89 | +// ============================================================================= |
| 90 | +// Check the diagnostics can be made into errors |
| 91 | +// ============================================================================= |
| 92 | + |
| 93 | +// FIXME: This doesn't work right now because |
| 94 | +// `TextDiagnosticBuffer::FlushDiagnostics` doesn't preserve diagnostic IDs when |
| 95 | +// flushing diagnostics (rdar://152730261) |
| 96 | + |
| 97 | +// ============================================================================= |
| 98 | +// Check the diagnostics can be suppressed |
| 99 | +// ============================================================================= |
| 100 | + |
| 101 | +// FIXME: This doesn't work right now because |
| 102 | +// `TextDiagnosticBuffer::FlushDiagnostics` doesn't preserve diagnostic IDs when |
| 103 | +// flushing diagnostics (rdar://152730261) |
0 commit comments