<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - clang-format: Assertion `PPLevelBranchCount[PPBranchLevel] == 0' failed on MipsJITInfo.cpp"
   href="http://llvm.org/bugs/show_bug.cgi?id=17630">17630</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang-format: Assertion `PPLevelBranchCount[PPBranchLevel] == 0' failed on MipsJITInfo.cpp
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>daniel.sanders@imgtec.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Steps to reproduce
==================

$ wget -O MipsJITInfo.cpp
'<a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsJITInfo.cpp?revision=187032&view=co">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsJITInfo.cpp?revision=187032&view=co</a>'
$ clang-format MipsJITInfo.cpp

Actual behaviour
================

Crash. Output below:
clang-format:
/home/das/mips/MSA/llvm/src/llvm/tools/clang/lib/Format/UnwrappedLineParser.cpp:488:
void clang::format::UnwrappedLineParser::parsePPEndIf(): Assertion
`PPLevelBranchCount[PPBranchLevel] == 0' failed.
0  libLLVMSupport.so 0x00007f947a4ba6de llvm::sys::PrintStackTrace(_IO_FILE*) +
38
1  libLLVMSupport.so 0x00007f947a4ba965
2  libLLVMSupport.so 0x00007f947a4ba3a0
3  libpthread.so.0   0x00007f947a18acb0
4  libc.so.6         0x00007f9478c51425 gsignal + 53
5  libc.so.6         0x00007f9478c54b8b abort + 379
6  libc.so.6         0x00007f9478c4a0ee
7  libc.so.6         0x00007f9478c4a192
8  libclangFormat.so 0x00007f9479f5410e
clang::format::UnwrappedLineParser::parsePPEndIf() + 268
9  libclangFormat.so 0x00007f9479f53b71
clang::format::UnwrappedLineParser::parsePPDirective() + 367
10 libclangFormat.so 0x00007f9479f5693c
clang::format::UnwrappedLineParser::readToken() + 200
11 libclangFormat.so 0x00007f9479f5686e
clang::format::UnwrappedLineParser::nextToken() + 96
12 libclangFormat.so 0x00007f9479f54894
clang::format::UnwrappedLineParser::parseStructuralElement() + 860
13 libclangFormat.so 0x00007f9479f533a3
clang::format::UnwrappedLineParser::parseLevel(bool) + 345
14 libclangFormat.so 0x00007f9479f53877
clang::format::UnwrappedLineParser::parseBlock(bool, bool, bool) + 219
15 libclangFormat.so 0x00007f9479f547d0
clang::format::UnwrappedLineParser::parseStructuralElement() + 664
16 libclangFormat.so 0x00007f9479f533a3
clang::format::UnwrappedLineParser::parseLevel(bool) + 345
17 libclangFormat.so 0x00007f9479f53217
clang::format::UnwrappedLineParser::parseFile() + 97
18 libclangFormat.so 0x00007f9479f52f3b
clang::format::UnwrappedLineParser::parse() + 175
19 libclangFormat.so 0x00007f9479f365d6
20 libclangFormat.so 0x00007f9479f38892
clang::format::reformat(clang::format::FormatStyle const&, clang::Lexer&,
clang::SourceManager&, std::vector<clang::CharSourceRange,
std::allocator<clang::CharSourceRange> >) + 132
21 clang-format      0x000000000040b93a
22 clang-format      0x000000000040c1c4
23 libc.so.6         0x00007f9478c3c76d __libc_start_main + 237
24 clang-format      0x000000000040add9
Aborted (core dumped)

Tested with r192963.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>