summaryrefslogtreecommitdiffstats
path: root/clang/test/Refactor
diff options
context:
space:
mode:
authorShaurya Gupta <shauryab98@gmail.com>2019-08-14 13:37:39 +0000
committerShaurya Gupta <shauryab98@gmail.com>2019-08-14 13:37:39 +0000
commit36ca1e6399feaaee1e007bafa40449fecdba70aa (patch)
treea32b98f21ee6cd787bfb53062ab1d7f62f352898 /clang/test/Refactor
parent40837e97b199b4d6546df9f8912e14a56c434417 (diff)
downloadbcm5719-llvm-36ca1e6399feaaee1e007bafa40449fecdba70aa.tar.gz
bcm5719-llvm-36ca1e6399feaaee1e007bafa40449fecdba70aa.zip
[Tooling] Added DeclStmtClass to ExtractionSemicolonPolicy
Since the DeclStmt range includes the semicolon, it doesn't need a semicolon at the end during extraction llvm-svn: 368850
Diffstat (limited to 'clang/test/Refactor')
-rw-r--r--clang/test/Refactor/Extract/ExtractionSemicolonPolicy.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/clang/test/Refactor/Extract/ExtractionSemicolonPolicy.cpp b/clang/test/Refactor/Extract/ExtractionSemicolonPolicy.cpp
index 97f12475761..865e8290923 100644
--- a/clang/test/Refactor/Extract/ExtractionSemicolonPolicy.cpp
+++ b/clang/test/Refactor/Extract/ExtractionSemicolonPolicy.cpp
@@ -193,7 +193,7 @@ void careForNonCompoundSemicolons2() {
// CHECK-NEXT: }
void careForSwitchSemicolon() {
- /*range mextract=->+0:51*/switch(0) default: break;
+ /*range mextract=->+0:53*/switch(0) default: break;
}
// CHECK: 1 'mextract' results:
// CHECK: static void extracted() {
@@ -203,3 +203,14 @@ void careForSwitchSemicolon() {
// CHECK-NEXT: extracted();{{$}}
// CHECK-NEXT: }
+void extractStatementNotSemiDecl() {
+ /*range nextract=->+0:38*/int x = 5;
+}
+// CHECK: 1 'nextract' results:
+// CHECK: static void extracted() {
+// CHECK-NEXT: int x = 5;{{$}}
+// CHECK-NEXT: }{{[[:space:]].*}}
+// CHECK-NEXT: void extractStatementNotSemiDecl() {
+// CHECK-NEXT: extracted();{{$}}
+// CHECK-NEXT: }
+
OpenPOWER on IntegriCloud