mirror of
https://github.com/dart-lang/sdk
synced 2024-09-20 04:01:29 +00:00
c885bdde1d
Change-Id: Ica33af158cca53c8e951e4b2582de83660e8a60d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121851 Commit-Queue: Samir Jindel <sjindel@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
35 lines
991 B
C++
35 lines
991 B
C++
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#include "vm/cpu.h"
|
|
#include "platform/assert.h"
|
|
#include "vm/globals.h"
|
|
#include "vm/unit_test.h"
|
|
|
|
namespace dart {
|
|
|
|
VM_UNIT_TEST_CASE(Id) {
|
|
#if defined(TARGET_ARCH_IA32)
|
|
EXPECT_STREQ("ia32", CPU::Id());
|
|
#elif defined(TARGET_ARCH_X64)
|
|
EXPECT_STREQ("x64", CPU::Id());
|
|
#elif defined(TARGET_ARCH_ARM)
|
|
#if defined(HOST_ARCH_ARM)
|
|
EXPECT_STREQ("arm", CPU::Id());
|
|
#else // defined(HOST_ARCH_ARM)
|
|
EXPECT_STREQ("simarm", CPU::Id());
|
|
#endif // defined(HOST_ARCH_ARM)
|
|
#elif defined(TARGET_ARCH_ARM64)
|
|
#if defined(HOST_ARCH_ARM64)
|
|
EXPECT_STREQ("arm64", CPU::Id());
|
|
#else // defined(HOST_ARCH_ARM64)
|
|
EXPECT_STREQ("simarm64", CPU::Id());
|
|
#endif // defined(HOST_ARCH_ARM64)
|
|
#else
|
|
#error Architecture was not detected as supported by Dart.
|
|
#endif
|
|
}
|
|
|
|
} // namespace dart
|