clang/tests/fedora-flags/test.sh
Timm Bäder 079bd3253f Update to 14.0.0
Resolves: rhbz#2061041
Resolves: rhbz#2061058
2022-05-05 07:00:25 +02:00

21 lines
555 B
Bash
Executable File

#!/bin/sh -eux
set pipefail
cflags=`rpm -D '%toolchain clang' -E %{build_cflags}`
cxxflags=`rpm -D '%toolchain clang' -E %{build_cxxflags}`
ldflags=`rpm -D '%toolchain clang' -E %{build_ldflags}`
# Test a c program
clang $cflags -c hello.c -o hello.o
clang $cflags -c main.c -o main.o
clang $ldflags -o hello main.o hello.o
./hello | grep "Hello World"
# Test a cxx program
clang++ $cxxflags -c hello.cpp -o hello-cpp.o
clang++ $cxxflags -c main.cpp -o main-cpp.o
clang++ $ldflags -o hello-cpp main-cpp.o hello-cpp.o
./hello-cpp | grep "Hello World"