   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 {

  @objc
  func h() -> Int { }
}

  func f1() -> Int { }

  func f2() -> Int { }

  @discardableResult
  func f1Optional() -> Int? { }

  func f2Optional() -> Int? { }
}

func testFunctionsInStruct(s1 : S1) {
