diff options
Diffstat (limited to 'test/CoverageMapping/switch.cpp')
-rw-r--r-- | test/CoverageMapping/switch.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/CoverageMapping/switch.cpp b/test/CoverageMapping/switch.cpp index 17aa53bb48..52f22e8eda 100644 --- a/test/CoverageMapping/switch.cpp +++ b/test/CoverageMapping/switch.cpp @@ -97,3 +97,16 @@ int fallthrough(int i) { // CHECK-NEXT: File 0, [[@LINE]]:24 -> [[@LINE+12]]:2 = break; } } + +void abort(void) __attribute((noreturn)); + // CHECK: noret +int noret(int x) { // CHECK-NEXT: File 0, [[@LINE]]:18 -> [[@LINE+9]]:2 + switch (x) { + default: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+1]]:12 + abort(); + case 1: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+1]]:13 + return 5; + case 2: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+1]]:14 + return 10; + } +} |