Wbuiltin-declaration-mismatch-12.c: New test.
authorMartin Sebor <msebor@redhat.com>
Fri, 22 Feb 2019 16:21:07 +0000 (16:21 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Fri, 22 Feb 2019 16:21:07 +0000 (09:21 -0700)
gcc/testsuite/ChangeLog:
* gcc.dg/Wbuiltin-declaration-mismatch-12.c: New test.

From-SVN: r269120

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-12.c [new file with mode: 0644]

index 5b2714478a2a8994997dc50163b91fde425dd86b..cb653e3652aef86f5b09e4ac13d459bdc5e4c420 100644 (file)
@@ -1,3 +1,7 @@
+2019-02-22  Martin Sebor  <msebor@redhat.com>
+
+       * gcc.dg/Wbuiltin-declaration-mismatch-12.c: New test.
+
 2019-02-22  H.J. Lu  <hongjiu.lu@intel.com>
            Hongtao Liu  <hongtao.liu@intel.com>
            Sunil K Pandey  <sunil.k.pandey@intel.com>
diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-12.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-12.c
new file mode 100644 (file)
index 0000000..6bf9762
--- /dev/null
@@ -0,0 +1,8 @@
+/* Verify that declaring the __clear_cache and __builtin_prefetch
+   intrinsic functions with the wrong signature is diagnosed.
+   { dg-do compile }
+   { dg-options "-Wbuiltin-declaration-mismatch -Wextra" } */
+
+extern void __clear_cache (char*, char*);   /* { dg-warning "mismatch in argument 1 type of built-in function .__clear_cache.; expected .void \\\*." } */
+
+void __builtin_prefetch (const char *, ...);   /* { dg-warning "mismatch in argument 1 type of built-in function .__builtin_prefetch.; expected .const void \\\*." } */