svn commit: r244692 - head/lib/libproc/test/t1-bkpt

Sergey Kandaurov pluknet at FreeBSD.org
Wed Dec 26 05:11:49 UTC 2012


Author: pluknet
Date: Wed Dec 26 05:11:48 2012
New Revision: 244692
URL: http://svnweb.freebsd.org/changeset/base/244692

Log:
  Fix libproc test case to work with clang premature optimization
  observed with -O2 (used by default).
  Avoid function inlining for t1_bkpt_t on which we set a breakpoint.
  Otherwise the address of the function is never called thus the
  breakpoint never triggers.
  
  Reported by:	zont
  Reviewed by:	rpaulo

Modified:
  head/lib/libproc/test/t1-bkpt/t1-bkpt.c

Modified: head/lib/libproc/test/t1-bkpt/t1-bkpt.c
==============================================================================
--- head/lib/libproc/test/t1-bkpt/t1-bkpt.c	Tue Dec 25 23:34:20 2012	(r244691)
+++ head/lib/libproc/test/t1-bkpt/t1-bkpt.c	Wed Dec 26 05:11:48 2012	(r244692)
@@ -36,7 +36,7 @@
 #include <string.h>
 #include <libproc.h>
 
-int
+int __noinline
 t1_bkpt_t()
 {
 	printf("TEST OK\n");


More information about the svn-src-all mailing list