Add size-1 and size-2 tests
* ld-size/size-1.c: New file. * ld-size/size-1.out: Likewise. * ld-size/size-1a.c: Likewise. * ld-size/size-1b.c: Likewise. * ld-size/size-2.c: Likewise. * ld-size/size-2.out: Likewise. * ld-size/size-2a.c: Likewise. * ld-size/size-2b.c: Likewise. * ld-size/size.exp (build_tests): Build libsize-1.so and libsize-2.so. (run_tests): Run size-1 and size-2.
This commit is contained in:
parent
ce24f61737
commit
1cf48f4842
@ -1,3 +1,18 @@
|
||||
2013-01-17 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* ld-size/size-1.c: New file.
|
||||
* ld-size/size-1.out: Likewise.
|
||||
* ld-size/size-1a.c: Likewise.
|
||||
* ld-size/size-1b.c: Likewise.
|
||||
* ld-size/size-2.c: Likewise.
|
||||
* ld-size/size-2.out: Likewise.
|
||||
* ld-size/size-2a.c: Likewise.
|
||||
* ld-size/size-2b.c: Likewise.
|
||||
|
||||
* ld-size/size.exp (build_tests): Build libsize-1.so and
|
||||
libsize-2.so.
|
||||
(run_tests): Run size-1 and size-2.
|
||||
|
||||
2013-01-17 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* ld-size/size32-3-i386.d: New file.
|
||||
|
12
ld/testsuite/ld-size/size-1.c
Normal file
12
ld/testsuite/ld-size/size-1.c
Normal file
@ -0,0 +1,12 @@
|
||||
#include <stdio.h>
|
||||
|
||||
extern int bar_size;
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if (bar_size == 10)
|
||||
printf ("OK\n");
|
||||
|
||||
return 0;
|
||||
}
|
1
ld/testsuite/ld-size/size-1.out
Normal file
1
ld/testsuite/ld-size/size-1.out
Normal file
@ -0,0 +1 @@
|
||||
OK
|
1
ld/testsuite/ld-size/size-1a.c
Normal file
1
ld/testsuite/ld-size/size-1a.c
Normal file
@ -0,0 +1 @@
|
||||
char bar[10] __attribute__ ((visibility("hidden")));
|
3
ld/testsuite/ld-size/size-1b.c
Normal file
3
ld/testsuite/ld-size/size-1b.c
Normal file
@ -0,0 +1,3 @@
|
||||
extern char bar[];
|
||||
extern char size_of_bar asm ("bar@SIZE");
|
||||
char *bar_size = &size_of_bar;
|
14
ld/testsuite/ld-size/size-2.c
Normal file
14
ld/testsuite/ld-size/size-2.c
Normal file
@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
|
||||
extern int bar_size;
|
||||
extern char *get_bar (int, int);
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
char *bar = get_bar (2, 20);
|
||||
if (bar_size == 10 && bar[2] == 20)
|
||||
printf ("OK\n");
|
||||
|
||||
return 0;
|
||||
}
|
1
ld/testsuite/ld-size/size-2.out
Normal file
1
ld/testsuite/ld-size/size-2.out
Normal file
@ -0,0 +1 @@
|
||||
OK
|
1
ld/testsuite/ld-size/size-2a.c
Normal file
1
ld/testsuite/ld-size/size-2a.c
Normal file
@ -0,0 +1 @@
|
||||
__thread char bar[10] __attribute__ ((visibility("hidden")));
|
10
ld/testsuite/ld-size/size-2b.c
Normal file
10
ld/testsuite/ld-size/size-2b.c
Normal file
@ -0,0 +1,10 @@
|
||||
extern __thread char bar[];
|
||||
extern char size_of_bar asm ("bar@SIZE");
|
||||
char *bar_size = &size_of_bar;
|
||||
|
||||
char *
|
||||
get_bar (int i, int v)
|
||||
{
|
||||
bar[i] = v;
|
||||
return bar;
|
||||
}
|
@ -55,6 +55,12 @@ if { [which $CC] == 0 } {
|
||||
}
|
||||
|
||||
set build_tests {
|
||||
{"Build libsize-1.so"
|
||||
"-shared" "-fPIC"
|
||||
{size-1a.c size-1b.c} {} "libsize-1.so"}
|
||||
{"Build libsize-2.so"
|
||||
"-shared" "-fPIC"
|
||||
{size-2a.c size-2b.c} {} "libsize-2.so"}
|
||||
{"Build libsize-3a.so"
|
||||
"-shared" "-fPIC"
|
||||
{size-3a.c} {} "libsize-3a.so"}
|
||||
@ -84,6 +90,12 @@ set build_tests {
|
||||
run_cc_link_tests $build_tests
|
||||
|
||||
set run_tests {
|
||||
{"Run size-1"
|
||||
"tmpdir/libsize-1.so" ""
|
||||
{size-1.c} "size-1" "size-1.out"}
|
||||
{"Run size-2"
|
||||
"tmpdir/libsize-2.so" ""
|
||||
{size-2.c} "size-2" "size-2.out"}
|
||||
{"Run size-3a"
|
||||
"" ""
|
||||
{size-3.c size-3a.c} "size-3a" "size-3.out"}
|
||||
|
Loading…
Reference in New Issue
Block a user