Commit b50002c4 by Andrew Stubbs Committed by Andrew Stubbs

Ignore LLVM's blank lines.

The GCN toolchain must use the LLVM assembler and linker because there's no
binutils port.  The LLVM tools do not have the same diagnostic style as
binutils, so the "blank line(s) in output" tests are inappropriate (and very
noisy).

The LLVM tools also have different command line options, so it's not possible
to autodetect object formats in the same way.

This patch addresses both issues.

2019-01-17  Andrew Stubbs  <ams@codesourcery.com>

	gcc/
	* doc/sourcebuild.texi: Document dg-require-effective-target
	llvm_binutils and offload_gcn.

	gcc/testsuite/
	* lib/file-format.exp (gcc_target_object_format): Handle AMD GCN.
	* lib/gcc-dg.exp (gcc-dg-prune): Ignore blank lines from the LLVM
	linker.
	* lib/target-supports.exp (check_effective_target_llvm_binutils): New.

From-SVN: r268027
parent 90eb9be6
2019-01-17 Andrew Stubbs <ams@codesourcery.com> 2019-01-17 Andrew Stubbs <ams@codesourcery.com>
* doc/sourcebuild.texi: Document dg-require-effective-target
llvm_binutils and offload_gcn.
2019-01-17 Andrew Stubbs <ams@codesourcery.com>
Kwok Cheung Yeung <kcy@codesourcery.com> Kwok Cheung Yeung <kcy@codesourcery.com>
Julian Brown <julian@codesourcery.com> Julian Brown <julian@codesourcery.com>
Tom de Vries <tom@codesourcery.com> Tom de Vries <tom@codesourcery.com>
......
...@@ -2265,6 +2265,9 @@ Target uses GNU @command{ld}. ...@@ -2265,6 +2265,9 @@ Target uses GNU @command{ld}.
Target keeps null pointer checks, either due to the use of Target keeps null pointer checks, either due to the use of
@option{-fno-delete-null-pointer-checks} or hardwired into the target. @option{-fno-delete-null-pointer-checks} or hardwired into the target.
@item llvm_binutils
Target is using an LLVM assembler and/or linker, instead of GNU Binutils.
@item lto @item lto
Compiler has been configured to support link-time optimization (LTO). Compiler has been configured to support link-time optimization (LTO).
...@@ -2289,6 +2292,9 @@ Target uses natural alignment (aligned to type size) for types of ...@@ -2289,6 +2292,9 @@ Target uses natural alignment (aligned to type size) for types of
@item nonpic @item nonpic
Target does not generate PIC by default. Target does not generate PIC by default.
@item offload_gcn
Target has been configured for OpenACC/OpenMP offloading on AMD GCN.
@item pie_enabled @item pie_enabled
Target generates PIE by default. Target generates PIE by default.
......
2019-01-17 Andrew Stubbs <ams@codesourcery.com> 2019-01-17 Andrew Stubbs <ams@codesourcery.com>
* lib/file-format.exp (gcc_target_object_format): Handle AMD GCN.
* lib/gcc-dg.exp (gcc-dg-prune): Ignore blank lines from the LLVM
linker.
* lib/target-supports.exp (check_effective_target_llvm_binutils): New.
2019-01-17 Andrew Stubbs <ams@codesourcery.com>
* gcc.dg/graphite/scop-19.c: Check pie_enabled. * gcc.dg/graphite/scop-19.c: Check pie_enabled.
* gcc.dg/pic-1.c: Disable on amdgcn. * gcc.dg/pic-1.c: Disable on amdgcn.
* gcc.dg/pic-2.c: Disable on amdgcn. * gcc.dg/pic-2.c: Disable on amdgcn.
......
...@@ -41,6 +41,9 @@ proc gcc_target_object_format { } { ...@@ -41,6 +41,9 @@ proc gcc_target_object_format { } {
} elseif { [istarget *-*-aix*] } { } elseif { [istarget *-*-aix*] } {
# AIX doesn't necessarily have objdump, so hand-code it. # AIX doesn't necessarily have objdump, so hand-code it.
set gcc_target_object_format_saved coff set gcc_target_object_format_saved coff
} elseif { [istarget *-*-amdhsa*] } {
# AMD GCN uses LLVM objdump which is not CLI-compatible
set gcc_target_object_format_saved elf
} else { } else {
set objdump_name [find_binutils_prog objdump] set objdump_name [find_binutils_prog objdump]
set open_file [open objfmtst.c w] set open_file [open objfmtst.c w]
......
...@@ -363,7 +363,7 @@ proc gcc-dg-prune { system text } { ...@@ -363,7 +363,7 @@ proc gcc-dg-prune { system text } {
# Complain about blank lines in the output (PR other/69006) # Complain about blank lines in the output (PR other/69006)
global allow_blank_lines global allow_blank_lines
if { !$allow_blank_lines } { if { !$allow_blank_lines && ![check_effective_target_llvm_binutils]} {
set num_blank_lines [llength [regexp -all -inline "\n\n" $text]] set num_blank_lines [llength [regexp -all -inline "\n\n" $text]]
if { $num_blank_lines } { if { $num_blank_lines } {
global testname_with_flags global testname_with_flags
......
...@@ -8779,6 +8779,14 @@ proc check_effective_target_offload_hsa { } { ...@@ -8779,6 +8779,14 @@ proc check_effective_target_offload_hsa { } {
} "-foffload=hsa" ] } "-foffload=hsa" ]
} }
# Return 1 if the compiler has been configured with hsa offloading.
proc check_effective_target_offload_gcn { } {
return [check_no_compiler_messages offload_gcn assembly {
int main () {return 0;}
} "-foffload=amdgcn-unknown-amdhsa" ]
}
# Return 1 if the target support -fprofile-update=atomic # Return 1 if the target support -fprofile-update=atomic
proc check_effective_target_profile_update_atomic {} { proc check_effective_target_profile_update_atomic {} {
return [check_no_compiler_messages profile_update_atomic assembly { return [check_no_compiler_messages profile_update_atomic assembly {
...@@ -9183,3 +9191,8 @@ foreach N {df} { ...@@ -9183,3 +9191,8 @@ foreach N {df} {
}] }]
} }
# Return 1 if this target uses an LLVM assembler and/or linker
proc check_effective_target_llvm_binutils { } {
return [expr { [istarget amdgcn*-*-*]
|| [check_effective_target_offload_gcn] } ]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment