   // CHECK: apply [[METHOD]]<{{.*}}>([[VALUE]])
   // CHECK: strong_release [[VALUE]]
   // CHECK-NOT: strong_release [[PLUS_ONE]]
-
-  // GUARANTEED: [[F:%.*]] = function_ref {{.*}}plusOneCP1
-  // GUARANTEED: [[PLUS_ONE:%.*]] = apply [[F]]()
-  // GUARANTEED: [[VALUE:%.*]] = open_existential_ref [[PLUS_ONE]]
-  // GUARANTEED: [[METHOD:%.*]] = function_ref
-  // GUARANTEED: apply [[METHOD]]<{{.*}}>([[VALUE]])
-  // GUARANTEED: strong_release [[VALUE]]
-  // GUARANTEED-NOT: strong_release [[PLUS_ONE]]
   plusOneCP1().f1()
 }
 

func plusOneCP1() -> CP1 {}

// CHECK-LABEL: sil hidden @_TF19protocol_extensions37test_open_existential_semantics_classFTPS_3CP1_PS0___T_
// GUARANTEED-LABEL: sil hidden @_TF19protocol_extensions37test_open_existential_semantics_classFTPS_3CP1_PS0___T_
func test_open_existential_semantics_class(guaranteed: CP1,
                                           var immediate: CP1) {
  // CHECK: [[IMMEDIATE_BOX:%.*]] = alloc_box $CP1
  // GUARANTEED: [[IMMEDIATE_BOX:%.*]] = alloc_box $CP1

  // CHECK-NOT: strong_retain %0
  // CHECK: [[VALUE:%.*]] = open_existential_ref %0

  // CHECK: apply [[METHOD]]<{{.*}}>([[VALUE]])
  // CHECK: deinit_existential_addr [[IMMEDIATE]]
  // CHECK: dealloc_stack [[IMMEDIATE]]
  immediate.f1()

  // CHECK: [[PLUS_ONE:%.*]] = alloc_stack $P1
