This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

patch: FRV: add TLS testcases


Ooops... forgot to include docuemntation and tests.

Tested on frv-elf.

Committed.

	* doc/invoke.texi: Document -mTLS.

	* testsuite/gcc.target/frv/all-tls-global-dynamic.c: New.
	* testsuite/gcc.target/frv/all-tls-initial-exec.c: New.
	* testsuite/gcc.target/frv/all-tls-initial-exec-pic.c: New.
	* testsuite/gcc.target/frv/all-tls-local-dynamic.c: New.
	* testsuite/gcc.target/frv/all-tls-local-dynamic-plt.c: New.
	* testsuite/gcc.target/frv/all-tls-local-dynamic-plt-pic.c: New.
	* testsuite/gcc.target/frv/all-tls-local-exec.c: New.
	* testsuite/gcc.target/frv/all-tls-local-exec-TLS.c: New.

	* configure.ac: Check for a TLS capable gas.

	* configure: Regenerate.

Index: doc/invoke.texi
===================================================================
RCS file: /cvs/uberbaum/gcc/doc/invoke.texi,v
retrieving revision 1.569
diff -c -p -r1.569 invoke.texi
*** doc/invoke.texi	19 Jan 2005 09:31:09 -0000	1.569
--- doc/invoke.texi	26 Jan 2005 20:29:13 -0000
*************** Objective-C and Objective-C++ Dialects}.
*** 461,466 ****
--- 461,467 ----
  -mvliw-branch  -mno-vliw-branch @gol
  -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
  -mno-nested-cond-exec  -mtomcat-stats @gol
+ -mTLS -mtls @gol
  -mcpu=@var{cpu}}
  
  @emph{H8/300 Options}
*************** shared libraries (i.e., @option{-fPIC} o
*** 7872,7877 ****
--- 7873,7888 ----
  optimization option such as @option{-O3} or above is present in the
  command line.
  
+ @item -mTLS
+ @opindex TLS
+ 
+ Assume a large TLS segment when generating thread-local code.
+ 
+ @item -mtls
+ @opindex tls
+ 
+ Do not assume a large TLS segment when generating thread-local code.
+ 
  @item -mgprel-ro
  @opindex mgprel-ro
  
Index: testsuite/gcc.target/frv/all-tls-global-dynamic.c
===================================================================
RCS file: testsuite/gcc.target/frv/all-tls-global-dynamic.c
diff -N testsuite/gcc.target/frv/all-tls-global-dynamic.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/gcc.target/frv/all-tls-global-dynamic.c	26 Jan 2005 20:29:13 -0000
***************
*** 0 ****
--- 1,12 ----
+ /* { dg-options "-ftls-model=global-dynamic -fpic -mfdpic -mno-inline-plt" } */
+ /* { dg-do compile } */
+ extern __thread int x;
+ extern void bar ();
+ int *y;
+ 
+ void foo (void)
+ {
+   bar ();
+   y = &x;
+ }
+ /* { dg-final { scan-assembler "call #gettlsoff.x." } } */
Index: testsuite/gcc.target/frv/all-tls-initial-exec.c
===================================================================
RCS file: testsuite/gcc.target/frv/all-tls-initial-exec.c
diff -N testsuite/gcc.target/frv/all-tls-initial-exec.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/gcc.target/frv/all-tls-initial-exec.c	26 Jan 2005 20:29:13 -0000
***************
*** 0 ****
--- 1,12 ----
+ /* { dg-options "-ftls-model=initial-exec -mfdpic" } */
+ /* { dg-do compile } */
+ extern __thread int x;
+ extern void bar ();
+ int *y;
+ 
+ void foo (void)
+ {
+   bar ();
+   y = &x;
+ }
+ /* { dg-final { scan-assembler "ld.*#tlsoff.x.@" } } */
Index: testsuite/gcc.target/frv/all-tls-initial-exec-pic.c
===================================================================
RCS file: testsuite/gcc.target/frv/all-tls-initial-exec-pic.c
diff -N testsuite/gcc.target/frv/all-tls-initial-exec-pic.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/gcc.target/frv/all-tls-initial-exec-pic.c	26 Jan 2005 20:29:13 -0000
***************
*** 0 ****
--- 1,12 ----
+ /* { dg-options "-ftls-model=initial-exec -fpic -mfdpic" } */
+ /* { dg-do compile } */
+ extern __thread int x;
+ extern void bar ();
+ int *y;
+ 
+ void foo (void)
+ {
+   bar ();
+   y = &x;
+ }
+ /* { dg-final { scan-assembler "ld.*#gottlsoff12" } } */
Index: testsuite/gcc.target/frv/all-tls-local-dynamic.c
===================================================================
RCS file: testsuite/gcc.target/frv/all-tls-local-dynamic.c
diff -N testsuite/gcc.target/frv/all-tls-local-dynamic.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/gcc.target/frv/all-tls-local-dynamic.c	26 Jan 2005 20:29:13 -0000
***************
*** 0 ****
--- 1,13 ----
+ /* { dg-options "-ftls-model=local-dynamic -fpic -mfdpic" } */
+ /* { dg-do compile } */
+ static __thread int x;
+ extern void bar ();
+ int *y;
+ 
+ void foo (void)
+ {
+   bar ();
+   y = &x;
+ }
+ /* { dg-final { scan-assembler "gettlsoff\\(0\\)" } } */
+ /* { dg-final { scan-assembler "tlsmoff12" } } */
Index: testsuite/gcc.target/frv/all-tls-local-dynamic-plt.c
===================================================================
RCS file: testsuite/gcc.target/frv/all-tls-local-dynamic-plt.c
diff -N testsuite/gcc.target/frv/all-tls-local-dynamic-plt.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/gcc.target/frv/all-tls-local-dynamic-plt.c	26 Jan 2005 20:29:13 -0000
***************
*** 0 ****
--- 1,12 ----
+ /* { dg-options "-ftls-model=local-dynamic -minline-plt -fPIC -mfdpic" } */
+ /* { dg-do compile } */
+ static __thread int x;
+ extern void bar ();
+ int *y;
+ 
+ void foo (void)
+ {
+   bar ();
+   y = &x;
+ }
+ /* { dg-final { scan-assembler "ldd.*tlsdesc\\(0\\)@" } } */
Index: testsuite/gcc.target/frv/all-tls-local-dynamic-plt-pic.c
===================================================================
RCS file: testsuite/gcc.target/frv/all-tls-local-dynamic-plt-pic.c
diff -N testsuite/gcc.target/frv/all-tls-local-dynamic-plt-pic.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/gcc.target/frv/all-tls-local-dynamic-plt-pic.c	26 Jan 2005 20:29:14 -0000
***************
*** 0 ****
--- 1,13 ----
+ /* { dg-options "-ftls-model=local-dynamic -minline-plt -fpic -mfdpic" } */
+ /* { dg-do compile } */
+ static __thread int x;
+ extern void bar ();
+ int *y;
+ 
+ void foo (void)
+ {
+   bar ();
+   y = &x;
+ }
+ /* { dg-final { scan-assembler "lddi.*gottlsdesc12" } } */
+ /* { dg-final { scan-assembler "calll.*#gettlsoff\\(0\\)" } } */
Index: testsuite/gcc.target/frv/all-tls-local-exec.c
===================================================================
RCS file: testsuite/gcc.target/frv/all-tls-local-exec.c
diff -N testsuite/gcc.target/frv/all-tls-local-exec.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/gcc.target/frv/all-tls-local-exec.c	26 Jan 2005 20:29:14 -0000
***************
*** 0 ****
--- 1,12 ----
+ /* { dg-options "-ftls-model=local-exec -mfdpic" } */
+ /* { dg-do compile } */
+ static __thread int x;
+ extern void bar ();
+ int *y;
+ 
+ void foo (void)
+ {
+   bar ();
+   y = &x;
+ }
+ /* { dg-final { scan-assembler ".*tlsmoff12" } } */
Index: testsuite/gcc.target/frv/all-tls-local-exec-TLS.c
===================================================================
RCS file: testsuite/gcc.target/frv/all-tls-local-exec-TLS.c
diff -N testsuite/gcc.target/frv/all-tls-local-exec-TLS.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/gcc.target/frv/all-tls-local-exec-TLS.c	26 Jan 2005 20:29:14 -0000
***************
*** 0 ****
--- 1,12 ----
+ /* { dg-options "-ftls-model=local-exec -mfdpic -mTLS" } */
+ /* { dg-do compile } */
+ static __thread int x;
+ extern void bar ();
+ int *y;
+ 
+ void foo (void)
+ {
+   bar ();
+   y = &x;
+ }
+ /* { dg-final { scan-assembler "sethi.*tlsmoffhi\\(x\\)," } } */
Index: configure.ac
===================================================================
RCS file: /cvs/uberbaum/gcc/configure.ac,v
retrieving revision 2.92
diff -c -p -r2.92 configure.ac
*** configure.ac	8 Jan 2005 23:14:06 -0000	2.92
--- configure.ac	26 Jan 2005 20:29:15 -0000
*************** foo:	.long	25
*** 2279,2284 ****
--- 2279,2293 ----
  	tls_first_minor=13
  	tls_as_opt=--fatal-warnings
  	;;
+   frv*-*-*)
+     conftest_s='
+ 	.section ".tdata","awT",@progbits
+ x:      .long   25
+         .text
+         call    #gettlsoff(x)'
+ 	tls_first_major=2
+ 	tls_first_minor=14
+ 	;;
    i[34567]86-*-*)
      conftest_s='
  	.section ".tdata","awT",@progbits


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]