#!/bin/bash
# Copyright (c) 2018-2019 Red Hat.
#
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published
# by the Free Software Foundation; either version 3, or (at your
# option) any later version.
#
# It is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
rm -f hello.o hello2.o hello3.o libhello.so hardening-fail-test.exe
GCC=${GCC:-gcc}
PLUGIN=${PLUGIN:-../gcc-plugin/.libs/annobin.so}
PLUGIN_OPTS="-fplugin-arg-annobin-no-attach -fplugin-arg-annobin-active-checks"
OPTS="-c"
$GCC -fplugin=$PLUGIN $PLUGIN_OPTS -c $OPTS $srcdir/hello.c
# FIXME: Add regexps to check for the expected failure messages