* c-c++-common/attr-nocf-check-1a.c: Remove test.
* c-c++-common/attr-nocf-check-3a.c: Likewise.
* gcc.target/i386/attr-nocf-check-1a.c: Add test.
* gcc.target/i386/attr-nocf-check-3a.c: Likewise.
From-SVN: r253984
+2017-10-22 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
+
+ * c-c++-common/attr-nocf-check-1a.c: Remove test.
+ * c-c++-common/attr-nocf-check-3a.c: Likewise.
+ * gcc.target/i386/attr-nocf-check-1a.c: Add test.
+ * gcc.target/i386/attr-nocf-check-3a.c: Likewise.
+
2017-10-21 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
* c-c++-common/attr-nocf-check-1.c: Shorten a cheking message.
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-options "-fcf-protection -mcet" } */
-
-int func (int) __attribute__ ((nocf_check));
-int (*fptr) (int) __attribute__ ((nocf_check));
-typedef void (*nocf_check_t) (void) __attribute__ ((nocf_check));
-
-int
-foo1 (int arg)
-{
- return func (arg) + fptr (arg);
-}
-
-void
-foo2 (void (*foo) (void))
-{
- void (*func) (void) __attribute__((nocf_check)) = foo; /* { dg-warning "incompatible pointer type" "" { target c } } */
- /* { dg-error "invalid conversion" "" { target c++ } .-1 } */
- func ();
-}
-
-void
-foo3 (nocf_check_t foo)
-{
- foo ();
-}
-
-void
-foo4 (void (*foo) (void) __attribute__((nocf_check)))
-{
- foo ();
-}
+++ /dev/null
-/* { dg-do compile } */
-/* { dg-options "-fcf-protection -mcet" } */
-
-int foo (void) __attribute__ ((nocf_check));
-void (*foo1) (void) __attribute__((nocf_check));
-void (*foo2) (void);
-
-int __attribute__ ((nocf_check))
-foo (void) /* The function's address is not tracked. */
-{
- /* This call site is not tracked for
- control-flow instrumentation. */
- (*foo1)();
-
- foo1 = foo2; /* { dg-warning "incompatible pointer type" "" { target c } } */
- /* { dg-error "invalid conversion" "" { target c++ } .-1 } */
- /* This call site is still not tracked for
- control-flow instrumentation. */
- (*foo1)();
-
- /* This call site is tracked for
- control-flow instrumentation. */
- (*foo2)();
-
- foo2 = foo1; /* { dg-warning "incompatible pointer type" "" { target c } } */
- /* { dg-error "invalid conversion" "" { target c++ } .-1 } */
- /* This call site is still tracked for
- control-flow instrumentation. */
- (*foo2)();
-
- return 0;
-}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-fcf-protection -mcet" } */
+
+int func (int) __attribute__ ((nocf_check));
+int (*fptr) (int) __attribute__ ((nocf_check));
+typedef void (*nocf_check_t) (void) __attribute__ ((nocf_check));
+
+int
+foo1 (int arg)
+{
+ return func (arg) + fptr (arg);
+}
+
+void
+foo2 (void (*foo) (void))
+{
+ void (*func) (void) __attribute__((nocf_check)) = foo; /* { dg-warning "incompatible pointer type" "" { target c } } */
+ /* { dg-error "invalid conversion" "" { target c++ } .-1 } */
+ func ();
+}
+
+void
+foo3 (nocf_check_t foo)
+{
+ foo ();
+}
+
+void
+foo4 (void (*foo) (void) __attribute__((nocf_check)))
+{
+ foo ();
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-fcf-protection -mcet" } */
+
+int foo (void) __attribute__ ((nocf_check));
+void (*foo1) (void) __attribute__((nocf_check));
+void (*foo2) (void);
+
+int __attribute__ ((nocf_check))
+foo (void) /* The function's address is not tracked. */
+{
+ /* This call site is not tracked for
+ control-flow instrumentation. */
+ (*foo1)();
+
+ foo1 = foo2; /* { dg-warning "incompatible pointer type" "" { target c } } */
+ /* { dg-error "invalid conversion" "" { target c++ } .-1 } */
+ /* This call site is still not tracked for
+ control-flow instrumentation. */
+ (*foo1)();
+
+ /* This call site is tracked for
+ control-flow instrumentation. */
+ (*foo2)();
+
+ foo2 = foo1; /* { dg-warning "incompatible pointer type" "" { target c } } */
+ /* { dg-error "invalid conversion" "" { target c++ } .-1 } */
+ /* This call site is still tracked for
+ control-flow instrumentation. */
+ (*foo2)();
+
+ return 0;
+}