From ca1a0b0061f287c615f45b61ea9f6a70e38ccf69 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Sun, 3 Dec 2023 00:51:13 -0800 Subject: [PATCH] elf/simple_cases: add hello world statically-linked to glibc it errors when reaching stwcx. --- src/openpower/test/elf/simple_cases.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/openpower/test/elf/simple_cases.py b/src/openpower/test/elf/simple_cases.py index 01bea293..a79bd34c 100644 --- a/src/openpower/test/elf/simple_cases.py +++ b/src/openpower/test/elf/simple_cases.py @@ -61,6 +61,15 @@ void _start() { } """ +static_glibc = r""" +#include + +int main() { + printf("Hello World!\n"); + return 0; +} +""" + # we have to specify *all* sprs that our binary might possibly need to # read, because ISACaller is annoying like that... # https://bugs.libre-soc.org/show_bug.cgi?id=1226#c2 @@ -85,3 +94,9 @@ class SimpleCases(TestAccumulatorBase): prog = compile_elf(SYSCALL_DEF + just_exit) self.add_case(prog, initial_sprs=initial_sprs.copy(), initial_msr=DEFAULT_USER_MSR) + + def case_static_glibc(self): + compiler_args = '-Os', '-static', '-xc' + prog = compile_elf(static_glibc, compiler_args) + self.add_case(prog, initial_sprs=initial_sprs.copy(), + initial_msr=DEFAULT_USER_MSR) -- 2.30.2