   @objc
   func h() -> Int { }
 }
+
+func testOptionalChaining(c1: C1?, s1: S1?) {
+  c1?.f1()         // okay
+  c1!.f1()         // okay
+  c1?.f1Optional() // okay
+  c1!.f1Optional() // okay
+  c1?.f2()         // expected-warning {{result of call to 'f2()' is unused}}
+  c1!.f2()         // expected-warning {{result of call to 'f2()' is unused}}
+  c1?.f2Optional() // expected-warning {{result of call to 'f2Optional()' is unused}}
+  c1!.f2Optional() // expected-warning {{result of call to 'f2Optional()' is unused}}
+
+  s1?.f1()         // okay
+  s1!.f1()         // okay
+  s1?.f1Optional() // okay
+  s1!.f1Optional() // okay
+  s1?.f2()         // expected-warning {{result of call to 'f2()' is unused}}
+  s1!.f2()         // expected-warning {{result of call to 'f2()' is unused}}
+  s1?.f2Optional() // expected-warning {{result of call to 'f2Optional()' is unused}}
+  s1!.f2Optional() // expected-warning {{result of call to 'f2Optional()' is unused}}
+}

  func f1() -> Int { }

  func f2() -> Int { }
}

func testFunctionsInStruct(s1 : S1) {

  s1.f1()           // okay
  s1.f2()           // expected-warning {{result of call to 'f2()' is unused}}
  _ = s1.f2()       // okay

  s1.f1Optional()   // okay
  s1.f2Optional()   // expected-warning {{result of call to 'f2Optional()' is unused}}
  _ = s1.f2Optional() // okay
}

protocol P1 {
