Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Dec 2012 05:11:48 +0000 (UTC)
From:      Sergey Kandaurov <pluknet@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244692 - head/lib/libproc/test/t1-bkpt
Message-ID:  <201212260511.qBQ5BmOs001404@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212260511.qBQ5BmOs001404>