Skip to content

Commit f6a2793

Browse files
authored
Merge pull request #73470 from drodriguez/function-sections-fix
[Test][Linux] Improve Gold/LLD detection for function_sections.swift
2 parents 4ef98f1 + 575cae8 commit f6a2793

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/LinkerSections/function_sections.swift

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// REQUIRES: OS=linux-gnu || OS=freebsd
22
// RUN: %empty-directory(%t)
3-
// RUN: %target-build-swift -Xfrontend -function-sections -emit-module -emit-library -static -parse-stdlib %S/Inputs/FunctionSections.swift
4-
// RUN: %target-build-swift -Xlinker -v -Xlinker --gc-sections -Xlinker -Map=%t/../../FunctionSections.map -I%t/../.. -L%t/../.. -lFunctionSections %S/Inputs/FunctionSectionsUse.swift 2>&1 | sed 's/.*\(gold\|LLD\).*/\1/g' | tr "[:lower:]" "[:upper:]" > %t/../../Linker.txt
5-
// RUN: %FileCheck --check-prefix $(cat %t/../../Linker.txt) %s < %t/../../FunctionSections.map
3+
// RUN: %target-build-swift -Xfrontend -function-sections -emit-module -emit-library -static -parse-stdlib %S/Inputs/FunctionSections.swift -o %t/libFunctionSections.a
4+
// RUN: %target-build-swift -Xlinker --gc-sections -Xlinker -Map=%t/FunctionSections.map -I%t -L%t -lFunctionSections %S/Inputs/FunctionSectionsUse.swift
5+
// RUN: if head -1 %t/FunctionSections.map | grep "Archive members"; then %FileCheck --check-prefix GOLD %s < %t/FunctionSections.map ; fi
6+
// RUN: if head -1 %t/FunctionSections.map | grep "VMA"; then %FileCheck --check-prefix LLD %s < %t/FunctionSections.map ; fi
67

78
// GOLD: Discarded input sections
89
// GOLD: .text.$s16FunctionSections5func2yyF

0 commit comments

Comments
 (0)