1 // RUN: clang-refactor extract -selection=test:%s %s -- -std=c++11 2>&1 | grep -v CHECK | FileCheck --check-prefixes=CHECK,CHECK-INNER %s
2 // RUN: clang-refactor extract -selection=test:%s %s -- -std=c++11 -DMULTIPLE 2>&1 | grep -v CHECK | FileCheck --check-prefixes=CHECK,CHECK-OUTER %s
6 #define PREFIX OuterClass ::
14 return /*range inner=->+0:38*/1 + 2 * 2;
16 // CHECK-INNER: 1 'inner' results:
17 // CHECK-INNER: static int extracted() {
18 // CHECK-INNER-NEXT: return 1 + 2 * 2;{{$}}
19 // CHECK-INNER-NEXT: }{{[[:space:]].*}}
20 // CHECK-INNER-NEXT: class AClass {
22 // CHECK-OUTER: 1 'inner' results:
23 // CHECK-OUTER: static int extracted() {
24 // CHECK-OUTER-NEXT: return 1 + 2 * 2;{{$}}
25 // CHECK-OUTER-NEXT: }{{[[:space:]].*}}
26 // CHECK-OUTER-NEXT: class OuterClass {
28 int otherMethod(int x
);
35 int PREFIX
AClass::otherMethod(int x
) {
36 return /*range outofline=->+0:46*/2 * 2 - 1;
38 // CHECK: 1 'outofline' results:
39 // CHECK: static int extracted() {
40 // CHECK-NEXT: return 2 * 2 - 1;{{$}}
41 // CHECK-NEXT: }{{[[:space:]].*}}
42 // CHECK-NEXT: int PREFIX AClass::otherMethod