diag-line-wrapping.cpp revision 64b0cee15206d55913240dca676ed3f340c60926
164b0cee15206d55913240dca676ed3f340c60926Chandler Carruth// RUN: %clang_cc1 -fsyntax-only -fmessage-length 60 %s 2>&1 | FileCheck %s
264b0cee15206d55913240dca676ed3f340c60926Chandler Carruth
364b0cee15206d55913240dca676ed3f340c60926Chandler Carruthstruct B { void f(); };
464b0cee15206d55913240dca676ed3f340c60926Chandler Carruthstruct D1 : B {};
564b0cee15206d55913240dca676ed3f340c60926Chandler Carruthstruct D2 : B {};
664b0cee15206d55913240dca676ed3f340c60926Chandler Carruthstruct DD : D1, D2 {
764b0cee15206d55913240dca676ed3f340c60926Chandler Carruth  void g() { f(); }
864b0cee15206d55913240dca676ed3f340c60926Chandler Carruth  // Ensure that after line-wrapping takes place, we preserve artificial
964b0cee15206d55913240dca676ed3f340c60926Chandler Carruth  // newlines introduced to manually format a section of the diagnostic text.
1064b0cee15206d55913240dca676ed3f340c60926Chandler Carruth  // CHECK: {{.*}}: error:
1164b0cee15206d55913240dca676ed3f340c60926Chandler Carruth  // CHECK: struct DD -> struct D1 -> struct B
1264b0cee15206d55913240dca676ed3f340c60926Chandler Carruth  // CHECK: struct DD -> struct D2 -> struct B
1364b0cee15206d55913240dca676ed3f340c60926Chandler Carruth}
14