Files
swift-mirror/test/InterfaceHash/delayedparsing.swift
Rintaro Ishizaki 4c9d9337ea [Parse] Fix hash accumulation in decl member parsing
For example, given:

  class C: P {
    func foo() {}
  }

For the outer context (i.e. source file), the interface hash shoule be
'class C : P { }' for the member list, it's '{ func foo ( ) { } }'.
This must be the same regardless delayed parsing is enabled.
2021-02-01 17:46:44 -08:00

23 lines
800 B
Swift

// RUN: %empty-directory(%t)
// RUN: %{python} %utils/split_file.py -o %t %s
// RUN: %target-swift-frontend -dump-interface-hash -primary-file %t/a.swift 2> %t/a.hash
// RUN: %target-swift-frontend -dump-interface-hash -primary-file %t/b.swift 2> %t/b.hash
// RUN: %target-swift-frontend -dump-interface-hash -primary-file %t/a.swift -experimental-skip-all-function-bodies 2> %t/c.hash
// RUN: %target-swift-frontend -dump-interface-hash -primary-file %t/b.swift -experimental-skip-all-function-bodies 2> %t/d.hash
// RUN: cmp %t/a.hash %t/b.hash
// RUN: cmp %t/a.hash %t/c.hash
// RUN: cmp %t/a.hash %t/d.hash
// Make sure "interface hash" doesn't change after modifying type members, and
// BEGIN a.swift
class C {
func foo() {}
}
// BEGIN b.swift
class C {
func foo() {}
func bar() {}
}