brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 626edef Raw
46 lines · cpp
1// RUN: not %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -strict-whitespace %s2 3/// empty lines in multi-line diagnostic snippets are preserved.4static_assert(false &&5 6              true, "");7// CHECK: static assertion failed8// CHECK-NEXT: {{^}}    4 | static_assert(false &&{{$}}9// CHECK-NEXT: {{^}}      |               ^~~~~~~~{{$}}10// CHECK-NEXT: {{^}}    5 | {{$}}11// CHECK-NEXT: {{^}}    6 |               true, "");{{$}}12// CHECK-NEXT: {{^}}      |               ~~~~{{$}}13 14 15/// #line pragmas are respected16void printf(const char *a, ...) __attribute__((__format__(__printf__, 1, 2)));17#line 1018void f(int x) {19  printf("%f",20         x);21}22// CHECK: 12:10: warning: format specifies type23// CHECK-NEXT: {{^}}   11 |24// CHECK-NEXT: {{^}}      |25// CHECK-NEXT: {{^}}      |26// CHECK-NEXT: {{^}}   12 |27 28#line 1029int func(30  int a, int b,31  int&32  r);33 34void test() {35  func(3, 4, 5);36}37// CHECK: 10:5: note: candidate function not viable38// CHECK-NEXT: {{^}}   10 |39// CHECK-NEXT: {{^}}      |40// CHECK-NEXT: {{^}}   11 |41// CHECK-NEXT: {{^}}   12 |42// CHECK-NEXT: {{^}}      |43// CHECK-NEXT: {{^}}   13 |44// CHECK-NEXT: {{^}}      |45 46