aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/attr-nocf-check-2.c
diff options
context:
space:
mode:
authorIgor Tsimbalist <igor.v.tsimbalist@intel.com>2017-10-20 19:29:02 +0200
committerIgor Tsimbalist <itsimbal@gcc.gnu.org>2017-10-20 19:29:02 +0200
commitb0926447b568fbcccd8edb6c4173864552711de0 (patch)
tree75e40ac779adece884a9e8d47b425fd564a0f34b /gcc/testsuite/c-c++-common/attr-nocf-check-2.c
parentc840bf9bc92e71291a9dc653688bf496aa219b7d (diff)
downloadgcc-b0926447b568fbcccd8edb6c4173864552711de0.zip
gcc-b0926447b568fbcccd8edb6c4173864552711de0.tar.gz
gcc-b0926447b568fbcccd8edb6c4173864552711de0.tar.bz2
Add tests for -fcf-protection option and nocf_check attribute.
* c-c++-common/fcf-protection-1.c: New test. * c-c++-common/fcf-protection-2.c: Likewise. * c-c++-common/fcf-protection-3.c: Likewise. * c-c++-common/fcf-protection-4.c: Likewise. * c-c++-common/fcf-protection-5.c: Likewise. * c-c++-common/attr-nocf-check-1.c: Likewise. * c-c++-common/attr-nocf-check-2.c: Likewise. * c-c++-common/attr-nocf-check-3.c: Likewise. From-SVN: r253949
Diffstat (limited to 'gcc/testsuite/c-c++-common/attr-nocf-check-2.c')
-rw-r--r--gcc/testsuite/c-c++-common/attr-nocf-check-2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/attr-nocf-check-2.c b/gcc/testsuite/c-c++-common/attr-nocf-check-2.c
new file mode 100644
index 0000000..9ab0180
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/attr-nocf-check-2.c
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+
+int var1 __attribute__((nocf_check)); /* { dg-warning "'nocf_check' attribute only applies to function types" } */
+int *var2 __attribute__((nocf_check)); /* { dg-warning "'nocf_check' attribute only applies to function types" } */
+void (**var3) (void) __attribute__((nocf_check)); /* { dg-warning "'nocf_check' attribute only applies to function types" } */