brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · a42de9c Raw
49 lines · c
1// Test the diagnostic messages of -verify with multiple prefixes.2// - Expected but not seen errors should contain the prefix of the directive3// - Seen but not expected errors should not choose an arbitrary prefix4// - "expected directive cannot follow '<prefix>-no-diagnostics'" should report an actual5//    expected-no-diagnostics prefix present in the source.6 7// RUN: not %clang_cc1 -verify=foo,bar %s 2>&1 | FileCheck %s --check-prefix=CHECK18// RUN: not %clang_cc1 -verify=bar,foo %s 2>&1 | FileCheck %s --check-prefix=CHECK19 10undefined_type x; // #111 12// foo-error{{there is no error here}}13// bar-error{{error not seen}}14// bar-note{{declared here}}15// bar-error{{another error not seen}}16// bar-error-re{{regex error{{}} not present}}17 18// CHECK1: error: diagnostics with 'error' severity expected but not seen: 19// CHECK1:   Line 12 'foo-error': there is no error here20// CHECK1:   Line 13 'bar-error': error not seen21// CHECK1:   Line 15 'bar-error': another error not seen22// CHECK1:   Line 16 'bar-error-re': regex error{{{{[}][}]}} not present23// CHECK1: error: diagnostics with 'error' severity seen but not expected: 24// CHECK1:   Line 10: unknown type name 'undefined_type'25// CHECK1: error: diagnostics with 'note' severity expected but not seen: 26// CHECK1:   Line 14 'bar-note': declared here27// CHECK1: 6 errors generated.28 29// RUN: not %clang_cc1 -verify=baz,qux,quux %s 2>&1 | FileCheck %s --check-prefix=CHECK230 31// qux-no-diagnostics32// baz-error@#1{{unknown type name 'undefined_type'}}33// quux-no-diagnostics34// qux-error-re@#1{{unknown type name 'undefined_type'}}35 36// CHECK2: error: diagnostics with 'error' severity seen but not expected: 37// CHECK2:   Line 10: unknown type name 'undefined_type'38// CHECK2:   Line 32: 'baz-error' directive cannot follow 'qux-no-diagnostics' directive39// CHECK2:   Line 34: 'qux-error-re' directive cannot follow 'qux-no-diagnostics' directive40 41// RUN: not %clang_cc1 -verify=spam,eggs %s 2>&1 | FileCheck %s --check-prefix=CHECK342 43// eggs-error@#1{{unknown type name 'undefined_type'}}44// spam-no-diagnostics45 46// CHECK3: error: diagnostics with 'error' severity seen but not expected: 47// CHECK3:   Line 44: 'spam-no-diagnostics' directive cannot follow other expected directives48// CHECK3: 1 error generated.49