From 0e8ca2a543f7670a8dbe885d6fd20abdee19eafb Mon Sep 17 00:00:00 2001 From: Tulio Magno Quites Machado Filho Date: Tue, 19 Sep 2023 11:57:40 -0300 Subject: [PATCH] Add a test that checks if debug information is disabled by default In a recent change to clang 17.0.0, debug information got enabled by default by mistake. Add a test that helps to prevent that. --- rhbz_2239619/main.fmf | 25 +++++++++++++++++++++++++ rhbz_2239619/runtest.sh | 9 +++++++++ rhbz_2239619/test.c | 3 +++ 3 files changed, 37 insertions(+) create mode 100644 rhbz_2239619/main.fmf create mode 100755 rhbz_2239619/runtest.sh create mode 100644 rhbz_2239619/test.c diff --git a/rhbz_2239619/main.fmf b/rhbz_2239619/main.fmf new file mode 100644 index 0000000..e0c5e69 --- /dev/null +++ b/rhbz_2239619/main.fmf @@ -0,0 +1,25 @@ +summary: Test if debug information is disabled by default +test: "$WITH_SCL ./runtest.sh" +require: [] +framework: shell +tier: 1 +component: + - llvm-toolset + - clang + +adjust: + # Common requirements when LLVM is not SCL-ized + - require+: + - clang + when: "collection is not defined" + + # Requirements for SCL-ized LLVM + - require+: + - llvm-toolset-13.0-clang + when: "collection == llvm-toolset-13.0" + - require+: + - llvm-toolset-14.0-clang + when: "collection == llvm-toolset-14.0" + - require+: + - llvm-toolset-15.0-clang + when: "collection == llvm-toolset-15.0" diff --git a/rhbz_2239619/runtest.sh b/rhbz_2239619/runtest.sh new file mode 100755 index 0000000..4f4559b --- /dev/null +++ b/rhbz_2239619/runtest.sh @@ -0,0 +1,9 @@ +#!/bin/sh -eux + +# Ensure that compiled code does not have debug information enabled by +# default. + +if clang -S test.c -o - | grep "\.section[[:space:]]\+\.debug_info"; then + echo "Error: debug information is enabled by default!" >&2 + exit 1 +fi diff --git a/rhbz_2239619/test.c b/rhbz_2239619/test.c new file mode 100644 index 0000000..ade4548 --- /dev/null +++ b/rhbz_2239619/test.c @@ -0,0 +1,3 @@ +int main(){ + return 0; +}