diff options
author | Vedant Kumar <vsk@apple.com> | 2016-05-31 18:06:19 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2016-05-31 18:06:19 +0000 |
commit | 3836482abcd2e26630026d71100852f45b25aa20 (patch) | |
tree | 1e6a00f82673149eaf4fbd41f2ae93555bbc882b /clang/test/CoverageMapping/switchmacro.c | |
parent | bdc2971434479d7c8e461959b7abb61cb04edd70 (diff) | |
download | bcm5719-llvm-3836482abcd2e26630026d71100852f45b25aa20.tar.gz bcm5719-llvm-3836482abcd2e26630026d71100852f45b25aa20.zip |
[Coverage] Fix crash on a switch partially covered by a macro (PR27948)
We have to handle file exits before and after visiting regions in the
switch body. Fixes PR27948.
llvm-svn: 271308
Diffstat (limited to 'clang/test/CoverageMapping/switchmacro.c')
-rw-r--r-- | clang/test/CoverageMapping/switchmacro.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/CoverageMapping/switchmacro.c b/clang/test/CoverageMapping/switchmacro.c index f2943b8ae44..f83d26fd168 100644 --- a/clang/test/CoverageMapping/switchmacro.c +++ b/clang/test/CoverageMapping/switchmacro.c @@ -32,6 +32,14 @@ default: ; END } +// PR27948 - Crash when handling a switch partially covered by a macro +// CHECK: baz +#define START2 switch (0) default: +void baz() { + for (;;) + START2 return; // CHECK: Expansion,File 0, [[@LINE]]:5 -> [[@LINE]]:11 = #1 (Expanded file = 1) +} + int main(int argc, const char *argv[]) { foo(3); return 0; |