[Coverage] Fix the start/end locations of switch statements
authorVedant Kumar <vsk@apple.com>
Fri, 4 Mar 2016 08:07:15 +0000 (08:07 +0000)
committerVedant Kumar <vsk@apple.com>
Fri, 4 Mar 2016 08:07:15 +0000 (08:07 +0000)
commit22bd871ea66538c1c21929828e2eca2185161c3e
treeaa80b9bff2dd8548eedf07d0ceb148928f6b3c46
parent37e594c79966900734dd1cc1bda3a9cafc48cd85
[Coverage] Fix the start/end locations of switch statements

While pushing switch statements onto the region stack we neglected to
specify their start/end locations. This results in a crash (PR26825) if
we end up in nested macro expansions without enough information to
handle the relevant file exits.

I added a test in switchmacro.c and fixed up a bunch of incorrect CHECK
lines that specify strange end locations for switches.

llvm-svn: 262697
clang/lib/CodeGen/CoverageMappingGen.cpp
clang/test/CoverageMapping/switch.c
clang/test/CoverageMapping/switchmacro.c