Merged this as per Mike“s comments.

Regards--
Subrata

On Tue, 2009-01-13 at 12:01 +0530, Subrata Modak wrote:
> Yes, it will still fail.
> 
> On Mon, 2009-01-12 at 19:30 -0200, Edjunior Barbosa Machado wrote:
> > minor fixes on tcore.c 
> > 
> > this patch includes LTP headers/libs to Makefile and defines
> > *TCID variable on tcore.c.
> > 
> > Signed-off-by: Edjunior B. Machado <[email protected]> 
> > diff --git a/testcases/misc/tcore_patch_test_suites/Makefile
> > b/testcases/misc/tcore_patch_test_suites/Makefile
> > index 7fcb375..51e6543 100644
> > --- a/testcases/misc/tcore_patch_test_suites/Makefile
> > +++ b/testcases/misc/tcore_patch_test_suites/Makefile
> > @@ -1,4 +1,6 @@
> >  CC=gcc
> > +CFLAGS+=       -I../../../include
> > +LOADLIBES+=    -L../../../lib -lltp -lm -lpthread
> 
> This is required.
> 
> >  MODCFLAGS := -Wall -DLINUX -I/usr/src/linux/include
> >  EXECS=tcore tcore.sh tcore.exp
> > 
> > @@ -8,7 +10,7 @@ install:
> >                 @set -e; for i in $(EXECS) ; do ln -f
> > $$i ../../bin/$$i ; done ;        
> > 
> >  tcore:         tcore.c
> > -               $(CC)  -o tcore tcore.c -lm -lpthread
> > +
> 
> This is not required, else, it will not compile at all in any machine.
> 
> >  clean:
> >         rm -f tcore
> > 
> > diff --git a/testcases/misc/tcore_patch_test_suites/tcore.c
> > b/testcases/misc/tcore_patch_test_suites/tcore.c
> > index bc51e10..e027e38 100644
> > --- a/testcases/misc/tcore_patch_test_suites/tcore.c
> > +++ b/testcases/misc/tcore_patch_test_suites/tcore.c
> > @@ -203,6 +203,8 @@ main (void)
> >  #include "test.h"
> >  #include "usctest.h"
> > 
> > +char *TCID="tcore";
> > +
> 
> Yes, this is required.
> 
> >  int TST_TOTAL = 0;              /* Total number of test cases. */
> > 
> >  int main() {
> > 
> 
> Here follows the updated Patch:
> Signed-Off-By: Subrata Modak <[email protected]>,
> Signed-Off-By: Edjunior Barbosa Machado <[email protected]>,
> --
> diff -uprN
> ltp-intermediate-20090105/testcases/misc/tcore_patch_test_suites.orig/Makefile
>  ltp-intermediate-20090105/testcases/misc/tcore_patch_test_suites/Makefile
> ---
> ltp-intermediate-20090105/testcases/misc/tcore_patch_test_suites.orig/Makefile
>         2009-01-13 11:36:30.000000000 +0530
> +++
> ltp-intermediate-20090105/testcases/misc/tcore_patch_test_suites/Makefile     
> 2009-01-13 11:41:06.000000000 +0530
> @@ -1,3 +1,5 @@
> +CFLAGS += -I../../../include -Wall
> +LDLIBS += -L../../../lib -lltp
>  CC=gcc
>  MODCFLAGS := -Wall -DLINUX -I/usr/src/linux/include
>  EXECS=tcore tcore.sh tcore.exp
> @@ -8,7 +10,7 @@ install: 
>               @set -e; for i in $(EXECS) ; do ln -f $$i ../../bin/$$i ; done 
> ;        
> 
>  tcore:               tcore.c
> -             $(CC)  -o tcore tcore.c -lm -lpthread
> +             $(CC)  -o tcore tcore.c $(CFLAGS) $(LDLIBS) -lm -lpthread
>  clean:
>       rm -f tcore
> 
> diff -uprN
> ltp-intermediate-20090105/testcases/misc/tcore_patch_test_suites.orig/tcore.c 
> ltp-intermediate-20090105/testcases/misc/tcore_patch_test_suites/tcore.c
> ---
> ltp-intermediate-20090105/testcases/misc/tcore_patch_test_suites.orig/tcore.c 
> 2009-01-13 11:36:30.000000000 +0530
> +++
> ltp-intermediate-20090105/testcases/misc/tcore_patch_test_suites/tcore.c
> 2009-01-13 11:53:45.000000000 +0530
> @@ -19,9 +19,17 @@
>   
> 
>  // Use gcc -o xmm xmm.c -pthread -lm to compile.
> +#include "test.h"
> +#include "usctest.h"
> 
> -#if defined __i386__ || defined(__x86_64__)
> +/* Extern Global Variables */
> +extern int  Tst_count;               /* counter for tst_xxx routines.
> */
> +extern char *TESTDIR;                /* temporary dir created by
> tst_tmpdir() */
> +/* Global Variables */
> +char *TCID     = "tcore";            /* test program identifier.
> */
> +int  TST_TOTAL = 1;                  /* total number of tests in this
> file.   */
> 
> +#if defined __i386__ || defined(__x86_64__)
>  #include <stdio.h>
>  #include <sys/types.h>
>  #include <unistd.h>
> @@ -112,11 +120,11 @@ producer (void *data)
>    a3 += b3;
>    a3 *= pow(b3, 2);
>    pid = getpid();
> -  printf("producer pid=%d\n", pid);
> +  tst_resm(TINFO,"producer pid=%d", pid);
>    sleep(1);
>    for (n = 0; n < 10000; n++)
>      {
> -      printf ("%d --->\n", n);
> +      tst_resm(TINFO,"%d --->", n);
>        put (&buffer, n);
> 
>        if (n==7686) {
> @@ -144,17 +152,17 @@ consumer (void *data)
>    char *junk = NULL;
>    pid_t pid;
>    long double a2 = 10002.5, b2 = 2888883.5;
> -  long double c2, d2, e2, f2;
> +  long double d2, e2, f2;
>    a2 += b2;
>    pid = getpid();
> -  printf("consumer pid=%d\n", pid);
> +  tst_resm(TINFO,"consumer pid=%d", pid);
>    sleep(1);
>    while (1)
>      {
>        d = get (&buffer);
>        if (d == OVER)
>       break;
> -      printf ("---> %d\n", d);
> +      tst_resm(TINFO,"---> %d", d);
>        if (d==7688) {
>           system("ps ax | grep ex");
>           d2 = pid * a2 / b2;
> @@ -164,7 +172,7 @@ consumer (void *data)
>       char buf[16];
>       char buf1[16];
>       sprintf(buf, "%d%d\n", pid, pid);
> -     sprintf(buf1,"%d",d2);
> +     sprintf(buf1,"%Lf",d2);
>          asm volatile ("movups (%0), %%xmm2;":: "r" (buf):"memory");
>          asm volatile ("movups (%0), %%xmm5;":: "r" (buf):"memory");
>       }
> @@ -180,7 +188,7 @@ main (void)
>    pthread_t th_a, th_b;
>    void *retval;
>    double a1 = 1.5, b1 = 2.5;
> -  long double c1, d1, e1;
> +  long double c1 ;
>    pid_t pid;
>    a1 += b1;
> 
> @@ -200,8 +208,6 @@ main (void)
> 
>  #else /* Not __i386__ */
> 
> -#include "test.h"
> -#include "usctest.h"
> 
>  int TST_TOTAL = 0;              /* Total number of test cases. */
> 
> diff -uprN
> ltp-intermediate-20090105/testcases/misc/tcore_patch_test_suites.orig/tcore.sh
>  ltp-intermediate-20090105/testcases/misc/tcore_patch_test_suites/tcore.sh
> ---
> ltp-intermediate-20090105/testcases/misc/tcore_patch_test_suites.orig/tcore.sh
>         2009-01-13 11:36:30.000000000 +0530
> +++
> ltp-intermediate-20090105/testcases/misc/tcore_patch_test_suites/tcore.sh     
> 2009-01-13 11:48:30.000000000 +0530
> @@ -17,6 +17,7 @@
>  #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
> 02111-1307 USA
> 
>  # Test suite for the t-core kernel patch 
> +export TCID=tcore01
>  PTHREAD_DIR="/lib/i686"
>  TEST_DIR="."
>  OSTYPE="redhat"
> 
> 
> Regards--
> Subrata
> 
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________ Ltp-list mailing list 
> [email protected] 
> https://lists.sourceforge.net/lists/listinfo/ltp-list


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to