From: Jacob Lifshay Date: Sun, 3 Dec 2023 08:51:13 +0000 (-0800) Subject: elf/simple_cases: add hello world statically-linked to glibc X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=684bb7c30e18c9d0c6a6cf6f8afc13d53680136d;p=openpower-isa.git elf/simple_cases: add hello world statically-linked to glibc it errors when reaching stwcx. --- 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)