From 6eaec1ec423bd0542fef3fc428c8139d4e162bb7 Mon Sep 17 00:00:00 2001 From: Jonas Termansen Date: Thu, 21 Dec 2023 14:00:34 +0000 Subject: [PATCH] [test] Check platform in exported_symbols_test. llvm-nm for Linux and macOS needs to be for the right operating system if the local checkout contains clang toolchains for other operating systems. Change-Id: I8de702474a6fa14f06b48e3e60756b3f414272f8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342940 Commit-Queue: Jonas Termansen Reviewed-by: Alexander Thomas --- runtime/tests/vm/dart/exported_symbols_test.dart | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/runtime/tests/vm/dart/exported_symbols_test.dart b/runtime/tests/vm/dart/exported_symbols_test.dart index 84eb89c9033..6b2abe4f25a 100644 --- a/runtime/tests/vm/dart/exported_symbols_test.dart +++ b/runtime/tests/vm/dart/exported_symbols_test.dart @@ -13,10 +13,14 @@ main() { var nm; for (var path in [ - "buildtools/linux-arm64/clang/bin/llvm-nm", - "buildtools/linux-x64/clang/bin/llvm-nm", - "buildtools/mac-arm64/clang/bin/llvm-nm", - "buildtools/mac-x64/clang/bin/llvm-nm", + if (Platform.isLinux) ...[ + "buildtools/linux-arm64/clang/bin/llvm-nm", + "buildtools/linux-x64/clang/bin/llvm-nm", + ], + if (Platform.isMacOS) ...[ + "buildtools/mac-arm64/clang/bin/llvm-nm", + "buildtools/mac-x64/clang/bin/llvm-nm", + ], ]) { if (new File(path).existsSync()) { nm = path;