diff --git a/lldb-dwz/main.fmf b/lldb-dwz/main.fmf new file mode 100644 index 0000000..2cbc00e --- /dev/null +++ b/lldb-dwz/main.fmf @@ -0,0 +1,18 @@ +summary: "Test that lldb doesn't crash with dwz debuginfo" +test: "$WITH_SCL ./test.sh" +require: + - coreutils-debuginfo + +adjust: + # Common requirements when LLVM is not SCL-ized + - require+: + - lldb + when: "collection is not defined" + + # Requirements for SCL-ized LLVM + - require+: + - llvm-toolset-13.0-lldb + when: "collection == llvm-toolset-13.0" + - require+: + - llvm-toolset-14.0-lldb + when: "collection == llvm-toolset-14.0" diff --git a/lldb-dwz/test.sh b/lldb-dwz/test.sh new file mode 100755 index 0000000..d9f8a31 --- /dev/null +++ b/lldb-dwz/test.sh @@ -0,0 +1,9 @@ +#!/bin/sh -eux + +lldb -b -o 'b main' -o run -o c -- true 2>&1 | tee lldb.log + +# lldb should report unsupported dwarf data, yet shouldn't crash +grep "unsupported DW_FORM values" lldb.log +grep "stop reason = breakpoint" lldb.log +# Ensure the process ends successfully (no crashes) +grep -E "Process [0-9]+ exited with status = 0" lldb.log diff --git a/lldb-std-vector-prettyprint/main.fmf b/lldb-std-vector-prettyprint/main.fmf new file mode 100644 index 0000000..443022a --- /dev/null +++ b/lldb-std-vector-prettyprint/main.fmf @@ -0,0 +1,11 @@ +summary: "Test lldb std::vector pretty printer" +test: "$WITH_SCL ./test.sh" +require: + - gcc-c++ + - lldb + +adjust: + # rhbz#2077932 rhbz#2082508 + - because: "std::vector pretty printer does not work properly in RHEL<9 due to older libstdc++" + enabled: false + when: distro < rhel-9 \ No newline at end of file diff --git a/lldb-std-vector-prettyprint/test.cpp b/lldb-std-vector-prettyprint/test.cpp new file mode 100644 index 0000000..397efa4 --- /dev/null +++ b/lldb-std-vector-prettyprint/test.cpp @@ -0,0 +1,9 @@ +#include +#include +int +main () +{ + std::vector v (1, 2); + std::vector::iterator it(v.begin()); + return 0; +} diff --git a/lldb-std-vector-prettyprint/test.sh b/lldb-std-vector-prettyprint/test.sh new file mode 100755 index 0000000..c87edea --- /dev/null +++ b/lldb-std-vector-prettyprint/test.sh @@ -0,0 +1,13 @@ +#!/bin/sh -eux + +g++ -g test.cpp + +lldb -b -o 'breakpoint set --file test.cpp --line 7' -o run -o 'p v' -- a.out | tee lldb.log + +test `grep \ + -e '(std::vector >) $0 = size=1 {' \ + -e '\[0\] = 2' \ + lldb.log \ + | wc -l` -eq 2 + +rm lldb.log diff --git a/python-embedded-interpreter/main.fmf b/python-embedded-interpreter/main.fmf new file mode 100644 index 0000000..12b58fe --- /dev/null +++ b/python-embedded-interpreter/main.fmf @@ -0,0 +1,24 @@ +summary: "Test lldb embedded interpreter (rhbz#1567262)" +description: "Ensure that lldb depends on python3-lldb" +test: "$WITH_SCL ./test.sh" +require: + - gcc-c++ +adjust: + # Common requirements when LLVM is not SCL-ized + - require+: + - lldb + environment+: + LLDB_PACKAGE: lldb + when: collection is not defined + + # Requirements for SCL-ized LLVM + - require+: + - llvm-toolset-13.0-lldb + environment+: + LLDB_PACKAGE: llvm-toolset-13.0-lldb + when: collection == llvm-toolset-13.0 + - require+: + - llvm-toolset-14.0-lldb + environment+: + LLDB_PACKAGE: llvm-toolset-14.0-lldb + when: collection == llvm-toolset-14.0 diff --git a/python-embedded-interpreter/test.cpp b/python-embedded-interpreter/test.cpp new file mode 100644 index 0000000..78427c2 --- /dev/null +++ b/python-embedded-interpreter/test.cpp @@ -0,0 +1,9 @@ +#include +#include +int +main () +{ + int i = 1; + float f = 1.0; + return 0; +} diff --git a/python-embedded-interpreter/test.sh b/python-embedded-interpreter/test.sh new file mode 100755 index 0000000..52b42e4 --- /dev/null +++ b/python-embedded-interpreter/test.sh @@ -0,0 +1,19 @@ +#!/bin/sh -eux + +# Verify the formal side of things, lldb should really depend on its Python bits. +rpm -q --requires "$LLDB_PACKAGE" | grep python3-lldb + +# Sanity test +g++ -g test.cpp + +lldb -b -o 'breakpoint set --file test.cpp --line 9' \ + -o run -o 'p i' -o 'p f'\ + -- a.out | tee lldb.log + +test `grep \ + -e '(int) $0 = 1' \ + -e '(float) $1 = 1' \ + lldb.log \ + | wc -l` -eq 2 + +rm lldb.log