public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Tom Stellard <tstellar@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/gcc] rhel-f41-base: Import gcc-fedora-flags test from redhat-rpm-config
Date: Mon, 29 Jun 2026 12:29:47 GMT	[thread overview]
Message-ID: <178273618719.1.10148460793802821105.rpms-gcc-d4fb9f8ed8cd@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/gcc
            Branch : rhel-f41-base
            Commit : d4fb9f8ed8cd9780656b2d1533f9da2cc4bc155f
            Author : Tom Stellard <tstellar@redhat.com>
            Date   : 2022-04-19T12:01:29-07:00
            Stats  : +61/-0 in 6 file(s)
            URL    : https://src.fedoraproject.org/rpms/gcc/c/d4fb9f8ed8cd9780656b2d1533f9da2cc4bc155f?branch=rhel-f41-base

            Log:
            Import gcc-fedora-flags test from redhat-rpm-config

Once this is committed, the version in redhat-rpm-config will be removed
and redhat-rpm-config will use this test.

---
diff --git a/tests/fedora-flags/hello.c b/tests/fedora-flags/hello.c
new file mode 100644
index 0000000..51b259b
--- /dev/null
+++ b/tests/fedora-flags/hello.c
@@ -0,0 +1,5 @@
+#include <stdio.h>
+
+void hello() {
+  printf("Hello World\n");
+}

diff --git a/tests/fedora-flags/hello.cpp b/tests/fedora-flags/hello.cpp
new file mode 100644
index 0000000..400612b
--- /dev/null
+++ b/tests/fedora-flags/hello.cpp
@@ -0,0 +1,5 @@
+#include <iostream>
+
+void hello() {
+  std::cout << "Hello World\n";
+}

diff --git a/tests/fedora-flags/main.c b/tests/fedora-flags/main.c
new file mode 100644
index 0000000..1a3455d
--- /dev/null
+++ b/tests/fedora-flags/main.c
@@ -0,0 +1,6 @@
+void hello();
+
+int main(int argc, char **argv) {
+  hello();
+  return 0;
+}

diff --git a/tests/fedora-flags/main.cpp b/tests/fedora-flags/main.cpp
new file mode 100644
index 0000000..1a3455d
--- /dev/null
+++ b/tests/fedora-flags/main.cpp
@@ -0,0 +1,6 @@
+void hello();
+
+int main(int argc, char **argv) {
+  hello();
+  return 0;
+}

diff --git a/tests/fedora-flags/main.fmf b/tests/fedora-flags/main.fmf
new file mode 100644
index 0000000..43934a7
--- /dev/null
+++ b/tests/fedora-flags/main.fmf
@@ -0,0 +1,10 @@
+summary: Test compiling with the Fedora C/CXX flags.
+description: ''
+component:
+  - gcc
+test: ./runtest.sh
+require:
+  - annobin-annocheck
+  - gcc
+  - gcc-c++
+  - redhat-rpm-config

diff --git a/tests/fedora-flags/runtest.sh b/tests/fedora-flags/runtest.sh
new file mode 100755
index 0000000..01b656b
--- /dev/null
+++ b/tests/fedora-flags/runtest.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+set -ex
+
+default_cflags=$(rpm -E '%{build_cflags}')
+default_cxxflags=$(rpm -E '%{build_cxxflags}')
+default_ldflags=$(rpm -E '%{build_ldflags}')
+
+cflags=$(rpm -D '%toolchain gcc' -E '%{build_cflags}')
+cxxflags=$(rpm -D '%toolchain gcc' -E '%{build_cxxflags}')
+ldflags=$(rpm -D '%toolchain gcc' -E '%{build_ldflags}')
+
+test "$default_cflags" = "$cflags"
+test "$default_cxxflags" = "$cxxflags"
+test "$default_ldflags" = "$ldflags"
+
+gcc $cflags -o hello.o -c hello.c
+annocheck hello.o
+gcc $cflags -o main.o -c main.c
+gcc $ldflags -o hello main.o hello.o
+annocheck hello
+./hello | grep "Hello World"
+
+g++ $cxxflags -o hello-cpp.o -c hello.cpp
+annocheck hello-cpp.o
+g++ $cxxflags -o main-cpp.o -c main.cpp
+g++ $ldflags -o hello-cpp main-cpp.o hello-cpp.o
+annocheck hello-cpp
+./hello-cpp | grep "Hello World"

                 reply	other threads:[~2026-06-29 12:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178273618719.1.10148460793802821105.rpms-gcc-d4fb9f8ed8cd@fedoraproject.org \
    --to=tstellar@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox