From: Carl Love Date: Wed, 2 Oct 2013 17:48:48 +0000 (+0000) Subject: The test case for the Transaction Memory instructions failes with older X-Git-Tag: svn/VALGRIND_3_9_0~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9b1e99239f232b31efb46fcbc55b1a2611d195a;p=thirdparty%2Fvalgrind.git The test case for the Transaction Memory instructions failes with older compilers as the -mhtm flag is not known. The patch fixes the makefile issue and addes #defines to the testcase code. The testcase was added in valgrind commit 13607. The bugzilla for adding the TM instruction support is 323803 git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13608 --- diff --git a/none/tests/ppc32/Makefile.am b/none/tests/ppc32/Makefile.am index a8b20194c2..dfd2d3fa82 100644 --- a/none/tests/ppc32/Makefile.am +++ b/none/tests/ppc32/Makefile.am @@ -88,7 +88,7 @@ DFP_FLAG = endif if HAS_ISA_2_07 -BUILD_FLAGS_ISA_2_07 = -mcpu=power8 +BUILD_FLAGS_ISA_2_07 = -mhtm -mcpu=power8 ISA_2_07_FLAG = -DHAS_ISA_2_07 else BUILD_FLAGS_ISA_2_07 = @@ -129,5 +129,5 @@ test_isa_2_07_part1_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -lm -g -mregnames $( test_isa_2_07_part2_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -lm -g -mregnames $(ISA_2_07_FLAG) \ @FLAG_M32@ $(BUILD_FLAGS_ISA_2_07) -test_tm_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -lm -g -mhtm -mregnames $(ISA_2_07_FLAG) \ +test_tm_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -lm -g -mregnames $(ISA_2_07_FLAG) \ @FLAG_M32@ $(BUILD_FLAGS_ISA_2_07) diff --git a/none/tests/ppc64/Makefile.am b/none/tests/ppc64/Makefile.am index 8ed6877b19..4607cdd164 100644 --- a/none/tests/ppc64/Makefile.am +++ b/none/tests/ppc64/Makefile.am @@ -69,7 +69,7 @@ DFP_FLAG = endif if HAS_ISA_2_07 -BUILD_FLAGS_ISA_2_07 = -mcpu=power8 +BUILD_FLAGS_ISA_2_07 = -mhtm -mcpu=power8 ISA_2_07_FLAG = -DHAS_ISA_2_07 else BUILD_FLAGS_ISA_2_07 = @@ -108,5 +108,5 @@ test_isa_2_07_part1_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -lm -g -mregnames $( test_isa_2_07_part2_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -lm -g -mregnames $(ISA_2_07_FLAG) \ @FLAG_M64@ $(BUILD_FLAGS_ISA_2_07) -test_tm_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -lm -g -mhtm -mregnames $(ISA_2_07_FLAG) \ +test_tm_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -lm -g -mregnames $(ISA_2_07_FLAG) \ @FLAG_M64@ $(BUILD_FLAGS_ISA_2_07) diff --git a/none/tests/ppc64/test_tm.c b/none/tests/ppc64/test_tm.c index 87306c1b4c..29eb5eb73c 100644 --- a/none/tests/ppc64/test_tm.c +++ b/none/tests/ppc64/test_tm.c @@ -1,4 +1,5 @@ #include +#ifdef HAS_ISA_2_07 int __attribute__ ((noinline)) htm_begin (int r3, int r4) { int ret; @@ -10,10 +11,13 @@ int __attribute__ ((noinline)) htm_begin (int r3, int r4) ret = r4; } return ret; } +#endif int main (void) { +#ifdef HAS_ISA_2_07 int ret; ret = htm_begin (10, 20); printf ("ret = %d, expected = 10\n", ret); +#endif return 0; }