diff --git a/test/LinkerSections/function_sections.swift b/test/LinkerSections/function_sections.swift index f941adec11a39..f7e9df726c05a 100644 --- a/test/LinkerSections/function_sections.swift +++ b/test/LinkerSections/function_sections.swift @@ -1,8 +1,9 @@ // REQUIRES: OS=linux-gnu || OS=freebsd // RUN: %empty-directory(%t) -// RUN: %target-build-swift -Xfrontend -function-sections -emit-module -emit-library -static -parse-stdlib %S/Inputs/FunctionSections.swift -// 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 -// RUN: %FileCheck --check-prefix $(cat %t/../../Linker.txt) %s < %t/../../FunctionSections.map +// RUN: %target-build-swift -Xfrontend -function-sections -emit-module -emit-library -static -parse-stdlib %S/Inputs/FunctionSections.swift -o %t/libFunctionSections.a +// RUN: %target-build-swift -Xlinker --gc-sections -Xlinker -Map=%t/FunctionSections.map -I%t -L%t -lFunctionSections %S/Inputs/FunctionSectionsUse.swift +// RUN: if head -1 %t/FunctionSections.map | grep "Archive members"; then %FileCheck --check-prefix GOLD %s < %t/FunctionSections.map ; fi +// RUN: if head -1 %t/FunctionSections.map | grep "VMA"; then %FileCheck --check-prefix LLD %s < %t/FunctionSections.map ; fi // GOLD: Discarded input sections // GOLD: .text.$s16FunctionSections5func2yyF