[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / libc / test / src / sys / utsname / uname_test.cpp
blob8f1c1c988afeb34d5206e22fe9bcba90ebe55512
1 //===-- Unittests for uname -----------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "src/__support/CPP/string_view.h"
10 #include "src/__support/macros/properties/architectures.h"
11 #include "src/sys/utsname/uname.h"
12 #include "test/ErrnoSetterMatcher.h"
13 #include "test/UnitTest/Test.h"
15 #include <errno.h>
16 #include <sys/utsname.h>
18 TEST(LlvmLibcUnameTest, GetMachineName) {
19 struct utsname names;
20 ASSERT_GE(__llvm_libc::uname(&names), 0);
21 #ifdef LIBC_TARGET_ARCH_IS_X86_64
22 ASSERT_STREQ(names.machine, "x86_64");
23 #elif defined(LIBC_TARGET_ARCH_IS_AARCH64)
24 ASSERT_STREQ(names.machine, "aarch64");
25 #endif