aboutsummaryrefslogtreecommitdiff
path: root/clang/test
diff options
context:
space:
mode:
authorShaurya Gupta <shauryab98@gmail.com>2019-08-08 08:37:49 +0000
committerShaurya Gupta <shauryab98@gmail.com>2019-08-08 08:37:49 +0000
commit7137736e49ce533930dd043b79f4c97f239c56f3 (patch)
tree6fbdd80d46e16b4aad70420600bb9f25903242dd /clang/test
parentbac7862c008e9807f1a78cb0f1823adc4120eaae (diff)
downloadllvm-7137736e49ce533930dd043b79f4c97f239c56f3.zip
llvm-7137736e49ce533930dd043b79f4c97f239c56f3.tar.gz
llvm-7137736e49ce533930dd043b79f4c97f239c56f3.tar.bz2
[Extract] Fixed SemicolonExtractionPolicy for SwitchStmt and SwitchCase
Reviewers: arphaman, sammccall Subscribers: dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65883 llvm-svn: 368267
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Refactor/Extract/ExtractionSemicolonPolicy.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/Refactor/Extract/ExtractionSemicolonPolicy.cpp b/clang/test/Refactor/Extract/ExtractionSemicolonPolicy.cpp
index 5caf9d4..97f1247 100644
--- a/clang/test/Refactor/Extract/ExtractionSemicolonPolicy.cpp
+++ b/clang/test/Refactor/Extract/ExtractionSemicolonPolicy.cpp
@@ -64,6 +64,7 @@ void extractStatementNotSemiSwitch() {
// CHECK-NEXT: extracted();{{$}}
// CHECK-NEXT: }
+
void extractStatementNotSemiWhile() {
/*range eextract=->+2:4*/while (true) {
int x = 0;
@@ -190,3 +191,15 @@ void careForNonCompoundSemicolons2() {
// CHECK-NEXT: extracted();{{$}}
// CHECK-NEXT: //
// CHECK-NEXT: }
+
+void careForSwitchSemicolon() {
+ /*range mextract=->+0:51*/switch(0) default: break;
+}
+// CHECK: 1 'mextract' results:
+// CHECK: static void extracted() {
+// CHECK-NEXT: switch(0) default: break;{{$}}
+// CHECK-NEXT: }{{[[:space:]].*}}
+// CHECK-NEXT: void careForSwitchSemicolon() {
+// CHECK-NEXT: extracted();{{$}}
+// CHECK-NEXT: }
+