-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ld: Document current "search" behavior
- Loading branch information
Showing
3 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// BEGIN PREAMBLE | ||
.version 3.1 | ||
.target sm_35 | ||
.address_size 64 | ||
// END PREAMBLE | ||
|
||
// BEGIN GLOBAL FUNCTION DECL: f | ||
.visible .func (.param.u32 %value_out) f (.param.u32 %in_ar0, .param.u32 %in_ar1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// BEGIN PREAMBLE | ||
.version 3.1 | ||
.target sm_35 | ||
.address_size 64 | ||
// END PREAMBLE | ||
|
||
// BEGIN GLOBAL FUNCTION DECL: f | ||
.visible .func (.param.u32 %value_out) f (.param.u32 %in_ar0, .param.u32 %in_ar1); | ||
|
||
// BEGIN GLOBAL FUNCTION DEF: f | ||
.visible .func (.param.u32 %value_out) f (.param.u32 %in_ar0, .param.u32 %in_ar1) | ||
{ | ||
// [...] | ||
ret; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
"Search" behavior. | ||
|
||
|
||
RUN: rm -rf %t | ||
RUN: mkdir -p %t | ||
RUN: printf '\0' > %t/NUL | ||
|
||
|
||
Assemble. | ||
|
||
RUN: mkdir %t/o | ||
|
||
RUN: %target_as_cmd -o %t/o/GLOBAL_FUNCTION_DECL_f.o %S/../GLOBAL_FUNCTION_DECL_f.s | ||
|
||
RUN: %target_as_cmd -o %t/o/GLOBAL_FUNCTION_DEF_f.o %S/../GLOBAL_FUNCTION_DEF_f.s | ||
|
||
|
||
Archive. | ||
|
||
RUN: mkdir %t/a | ||
|
||
RUN: %target_ar_cmd rcs %t/a/libGLOBAL_FUNCTION_f.a %t/o/GLOBAL_FUNCTION_DEF_f.o | ||
|
||
|
||
Link manually. | ||
|
||
RUN: cat %t/o/GLOBAL_FUNCTION_DECL_f.o %t/NUL %t/o/GLOBAL_FUNCTION_DEF_f.o %t/NUL > %t.nvptx.golden | ||
|
||
|
||
Test. | ||
|
||
RUN: rm -f %t.nvptx | ||
RUN: %target_ld_cmd -o %t.nvptx %t/o/GLOBAL_FUNCTION_DECL_f.o %t/o/GLOBAL_FUNCTION_DEF_f.o > %t.stdout 2> %t.stderr | ||
RUN: cmp %t.nvptx.golden %t.nvptx | ||
RUN: ! test -s %t.stdout | ||
RUN: ! test -s %t.stderr | ||
|
||
TODO Not testing with linker input file '%t/a/libGLOBAL_FUNCTION_f.a', as we don't support that yet. | ||
|
||
RUN: rm -f %t.nvptx | ||
RUN: %target_ld_cmd -o %t.nvptx -L%t/o ./GLOBAL_FUNCTION_DECL_f.o ./GLOBAL_FUNCTION_DEF_f.o > %t.stdout 2> %t.stderr; r=$?; [ x"$r" = x1 ] | ||
RUN: ! test -f %t.nvptx | ||
RUN: ! test -s %t.stdout | ||
RUN: echo 'error opening ./GLOBAL_FUNCTION_DECL_f.o' > %t.stderr.golden | ||
RUN: cmp %t.stderr.golden %t.stderr | ||
|
||
TODO The following one unexpectedly works: | ||
|
||
RUN: rm -f %t.nvptx | ||
RUN: %target_ld_cmd -o %t.nvptx -L%t/o GLOBAL_FUNCTION_DECL_f.o GLOBAL_FUNCTION_DEF_f.o > %t.stdout 2> %t.stderr | ||
RUN: cmp %t.nvptx.golden %t.nvptx | ||
RUN: ! test -s %t.stdout | ||
RUN: ! test -s %t.stderr | ||
|
||
RUN: rm -f %t.nvptx | ||
RUN: ( cd %t/o/ && %target_ld_cmd -o %t.nvptx GLOBAL_FUNCTION_DECL_f.o GLOBAL_FUNCTION_DEF_f.o > %t.stdout 2> %t.stderr ) | ||
RUN: cmp %t.nvptx.golden %t.nvptx | ||
RUN: ! test -s %t.stdout | ||
RUN: ! test -s %t.stderr | ||
|
||
RUN: rm -f %t.nvptx | ||
RUN: %target_ld_cmd -o %t.nvptx %t/o/GLOBAL_FUNCTION_DECL_f.o -L%t/a -lGLOBAL_FUNCTION_f > %t.stdout 2> %t.stderr | ||
RUN: cmp %t.nvptx.golden %t.nvptx | ||
RUN: ! test -s %t.stdout | ||
RUN: ! test -s %t.stderr | ||
|
||
RUN: rm -f %t.nvptx | ||
RUN: %target_ld_cmd -o %t.nvptx %t/o/GLOBAL_FUNCTION_DECL_f.o -lGLOBAL_FUNCTION_f > %t.stdout 2> %t.stderr; r=$?; [ x"$r" = x1 ] | ||
RUN: ! test -f %t.nvptx | ||
RUN: ! test -s %t.stdout | ||
RUN: echo 'error opening libGLOBAL_FUNCTION_f.a' > %t.stderr.golden | ||
RUN: cmp %t.stderr.golden %t.stderr | ||
|
||
TODO The following one unexpectedly works: | ||
|
||
RUN: rm -f %t.nvptx | ||
RUN: ( cd %t/a/ && %target_ld_cmd -o %t.nvptx %t/o/GLOBAL_FUNCTION_DECL_f.o -lGLOBAL_FUNCTION_f > %t.stdout 2> %t.stderr ) | ||
RUN: cmp %t.nvptx.golden %t.nvptx | ||
RUN: ! test -s %t.stdout | ||
RUN: ! test -s %t.stderr | ||
|
||
RUN: rm -f %t.nvptx | ||
RUN: ( cd %t/a/ && %target_ld_cmd -o %t.nvptx %t/o/GLOBAL_FUNCTION_DECL_f.o -L. -lGLOBAL_FUNCTION_f > %t.stdout 2> %t.stderr ) | ||
RUN: cmp %t.nvptx.golden %t.nvptx | ||
RUN: ! test -s %t.stdout | ||
RUN: ! test -s %t.stderr |