Skip to content

Commit 74dc488

Browse files
committed
Merge tag 'nolibc.2022.12.02a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu
Pull nolibc updates from Paul McKenney: - Further improvements to nolibc testing * tag 'nolibc.2022.12.02a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: selftests/nolibc: Always rebuild the sysroot when running a test selftests/nolibc: Add 7 tests for memcmp()
2 parents f433cf2 + 4a95be7 commit 74dc488

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

tools/testing/selftests/nolibc/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ all: run
9595
sysroot: sysroot/$(ARCH)/include
9696

9797
sysroot/$(ARCH)/include:
98+
$(Q)rm -rf sysroot/$(ARCH) sysroot/sysroot
9899
$(QUIET_MKDIR)mkdir -p sysroot
99100
$(Q)$(MAKE) -C ../../../include/nolibc ARCH=$(ARCH) OUTPUT=$(CURDIR)/sysroot/ headers_standalone
100101
$(Q)mv sysroot/sysroot sysroot/$(ARCH)
@@ -133,3 +134,5 @@ clean:
133134
$(Q)rm -rf initramfs
134135
$(call QUIET_CLEAN, run.out)
135136
$(Q)rm -rf run.out
137+
138+
.PHONY: sysroot/$(ARCH)/include

tools/testing/selftests/nolibc/nolibc-test.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,13 @@ int run_stdlib(int min, int max)
565565
CASE_TEST(strchr_foobar_z); EXPECT_STRZR(1, strchr("foobar", 'z')); break;
566566
CASE_TEST(strrchr_foobar_o); EXPECT_STREQ(1, strrchr("foobar", 'o'), "obar"); break;
567567
CASE_TEST(strrchr_foobar_z); EXPECT_STRZR(1, strrchr("foobar", 'z')); break;
568+
CASE_TEST(memcmp_20_20); EXPECT_EQ(1, memcmp("aaa\x20", "aaa\x20", 4), 0); break;
569+
CASE_TEST(memcmp_20_60); EXPECT_LT(1, memcmp("aaa\x20", "aaa\x60", 4), 0); break;
570+
CASE_TEST(memcmp_60_20); EXPECT_GT(1, memcmp("aaa\x60", "aaa\x20", 4), 0); break;
571+
CASE_TEST(memcmp_20_e0); EXPECT_LT(1, memcmp("aaa\x20", "aaa\xe0", 4), 0); break;
572+
CASE_TEST(memcmp_e0_20); EXPECT_GT(1, memcmp("aaa\xe0", "aaa\x20", 4), 0); break;
573+
CASE_TEST(memcmp_80_e0); EXPECT_LT(1, memcmp("aaa\x80", "aaa\xe0", 4), 0); break;
574+
CASE_TEST(memcmp_e0_80); EXPECT_GT(1, memcmp("aaa\xe0", "aaa\x80", 4), 0); break;
568575
case __LINE__:
569576
return ret; /* must be last */
570577
/* note: do not set any defaults so as to permit holes above */

0 commit comments

Comments
 (0)