Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Refactor / Extract / ObjCProperty.m
blob152ccb3484215641b14a1678daf6cf20fca2eadf
1 // RUN: clang-refactor extract -selection=test:%s %s -- 2>&1 | grep -v CHECK | FileCheck %s
3 @interface HasProperty
5 @property (strong) HasProperty *item;
7 - (HasProperty *)implicitProp;
9 - (void)setImplicitSetter:(HasProperty *)value;
11 @end
13 @implementation HasProperty
15 - (void)allowGetterExtraction {
16   /*range allow_getter=->+0:42*/self.item;
17   /*range allow_imp_getter=->+0:54*/self.implicitProp;
19 // CHECK: 1 'allow_getter' results:
20 // CHECK:      extracted() {
21 // CHECK-NEXT: return self.item;{{$}}
22 // CHECK-NEXT: }{{[[:space:]].*}}
23 // CHECK-NEXT: - (void)allowGetterExtraction {
24 // CHECK-NEXT: extracted();
26 // CHECK: 1 'allow_imp_getter' results:
27 // CHECK:      extracted() {
28 // CHECK-NEXT: return self.implicitProp;{{$}}
29 // CHECK-NEXT: }{{[[:space:]].*}}
30 // CHECK-NEXT: - (void)allowGetterExtraction {
31 // CHECK-NEXT: self.item;
32 // CHECK-NEXT: extracted();
34 - (void)prohibitSetterExtraction {
35   /*range prohibit_setter=->+0:45*/self.item = 0;
36   /*range prohibit_setter=->+0:55*/self.implicitSetter = 0;
38 // CHECK: 2 'prohibit_setter' results:
39 // CHECK: the selected expression can't be extracted
41 @end