%ifarch x86_64
%add_optflags %optflags_shared
%endif
%{?optflags_lto:%global optflags_lto %optflags_lto -ffat-lto-objects}

Name:           test-lto-add-optflags
Version:        1
Release:        alt1
Summary:        LL
License:        LGPLv2+
URL:            https://ll.github.io
Group:          System/Libraries

%description
%%add_optflags breaks redefinition of optflags_lto

%prep

%build

if echo %optflags | grep ffat-lto-objects; then
	echo test passed
else
	echo optflags=%optflags
	echo 'FATAL: -ffat-lto-objects is missing !'
	exit 1
fi

%install
mkdir %{buildroot}

%files

%changelog
* Sat Oct 09 2021 Igor Vlasenko <viy@altlinux.org> 1-alt1
- new version
