Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add armv7 CI #1524

Open
wants to merge 1 commit into
base: static_h
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ workflows:
sanitize: ["ON", "OFF"]
gc: ["MALLOC", "HADES"]
- test-linux
- test-linux-armv7

jobs:
test-macos:
Expand Down Expand Up @@ -70,3 +71,26 @@ jobs:
cmake -S hermes -B build
cmake --build build -j 4
cmake --build build --target check-hermes -j 4

test-linux-armv7:
docker:
- image: arm32v7/ubuntu:jammy
resource_class: arm.medium
environment:
- DEBIAN_FRONTEND: noninteractive
working_directory: /root
steps:
- run:
name: Install dependencies
command: |
apt update
apt install -y git openssh-client cmake build-essential \
libicu-dev zip python3 tzdata clang-15
- checkout:
path: hermes
- run:
name: Run Hermes regression tests
command: |
cmake -S hermes -B build
cmake --build build -j 4
cmake --build build --target check-hermes -j 4
11 changes: 6 additions & 5 deletions unittests/VMRuntime/StringPrimitiveTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,15 @@ TEST_F(StringPrimTest, ConcatTest) {
// an interior pointer, or if someone else maintained a pointer to the string.
template <typename StringType>
void test1StringMemcpySafety(const StringType &s) {
// memcpy the string so we can freely poke at its contents.
llvh::AlignedCharArrayUnion<StringType> mb;
memcpy(mb.buffer, &s, sizeof(StringType));

// Grub through the string's bits, looking for pointers to the interior of the
// string.
intptr_t start = reinterpret_cast<intptr_t>(&s);
intptr_t end = reinterpret_cast<intptr_t>(&s + 1);
const intptr_t *stringGuts = reinterpret_cast<const intptr_t *>(&s);
const intptr_t *stringGuts = reinterpret_cast<intptr_t *>(mb.buffer);
for (size_t i = 0; i < sizeof(StringType) / sizeof(void *); i++) {
intptr_t p = stringGuts[i];
EXPECT_FALSE(start <= p && p <= end) << "string size: " << s.size();
Expand All @@ -163,10 +167,7 @@ void test1StringMemcpySafety(const StringType &s) {
EXPECT_FALSE(start <= p && p <= end) << "string size: " << s.size();
}

// memcpy our string and verify the buffer, when interpreted as a string, is
// equal to the original.
llvh::AlignedCharArrayUnion<StringType> mb;
memcpy(mb.buffer, &s, sizeof(StringType));
// Verify the buffer, when interpreted as a string, is equal to the original.
const StringType *memcpydStr =
reinterpret_cast<const StringType *>(mb.buffer);
EXPECT_EQ(s, *memcpydStr) << "string size: " << s.size();
Expand Down