Skip to content
Snippets Groups Projects
Commit 8cb71598 authored by Jakub Jelinek's avatar Jakub Jelinek Committed by Jakub Jelinek
Browse files

null-8.C (bar): New function.

	* g++.dg/ubsan/null-8.C (bar): New function.
	(foo): Use bar instead of __builtin_printf.

From-SVN: r255162
parent b8cb3096
No related branches found
No related tags found
No related merge requests found
2017-11-27 Jakub Jelinek <jakub@redhat.com> 2017-11-27 Jakub Jelinek <jakub@redhat.com>
   
* g++.dg/ubsan/null-8.C (bar): New function.
(foo): Use bar instead of __builtin_printf.
PR debug/81307 PR debug/81307
* g++.dg/debug/debug9.C: Remove -fno-reorder-blocks-and-partition * g++.dg/debug/debug9.C: Remove -fno-reorder-blocks-and-partition
workaround. workaround.
......
...@@ -3,13 +3,20 @@ ...@@ -3,13 +3,20 @@
// { dg-options "-fsanitize=null -std=c++14" } // { dg-options "-fsanitize=null -std=c++14" }
// { dg-output "reference binding to null pointer of type 'const int'" } // { dg-output "reference binding to null pointer of type 'const int'" }
__attribute__((noinline, noclone))
void
bar (int x)
{
asm volatile ("" : : "r" (x) : "memory");
}
void void
foo (const int &iref) foo (const int &iref)
{ {
if (&iref) if (&iref)
__builtin_printf ("iref %d\n", iref); bar (iref);
else else
__builtin_printf ("iref is NULL\n"); bar (1);
} }
int int
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment