Skip to content

Commit d166892

Browse files
committed
multifile: make protocol-conformance-member pass on Windows
PE/COFF does not include a symbol table in the generated executable binary. Instead, use `public` to expose the getter, and then use `-coff-exports` from `llvm-readobj` to get the symbols that are exported. Fortunately, the same tool can be used to list the symbol table contents for ELF and MachO binary. This allows us to share the test across all the targets.
1 parent 8420a00 commit d166892

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
struct CoolStruct {
2-
let coolFactor: Double
1+
public struct CoolStruct {
2+
public let coolFactor: Double
33
}

test/multifile/protocol-conformance-member.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift -emit-library %s %S/Inputs/protocol-conformance-member-helper.swift -o %t/%target-library-name(Test) -module-name Test
3-
// RUN: llvm-nm %t/%target-library-name(Test) | %FileCheck %s
3+
// RUN: llvm-readobj -symbols -coff-exports %t/%target-library-name(Test) | %FileCheck %s
44

5-
// CHECK: $s4Test10CoolStructV10coolFactorSdvg
5+
// CHECK: Name: {{_?}}$s4Test10CoolStructV10coolFactorSdvg
66

77
// SR-156: Make sure we synthesize getters for members used as protocol
88
// witnesses. Check that we link correctly; we don't care which file

0 commit comments

Comments
 (0)