-# Copyright (C) 2002, 2003, 2005, 2007, 2008, 2009, 2010, 2011
-# Free Software Foundation, Inc.
+# Copyright (C) 2002-2020 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# Tests for Powerpc AltiVec ABI
-if $tracelevel then {
- strace $tracelevel
-}
-
#
# This file uses altivec-abi.c for input.
#
return
}
-set testfile "altivec-abi"
-set binfile ${objdir}/${subdir}/${testfile}
-set srcfile ${testfile}.c
+standard_testfile
-if [get_compiler_info $binfile] {
+if [get_compiler_info] {
warning "get_compiler failed"
return -1
}
set compile_flags "debug nowarnings $extra_flags"
if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable $compile_flags] != "" } {
- untested altivec-abi.exp
+ untested "failed to compile"
return -1
}
if { "$force_abi" == "auto" } {
# If the toolchain does not record attributes, skip auto-ABI tests.
- set readelf_program [transform readelf]
+ set readelf_program [gdb_find_readelf]
set result [catch "exec $readelf_program -A $binfile" output]
if {$result == 0 && ![regexp Tag_GNU_Power_ABI_Vector $output]} {
# Run to `main' where we begin our tests.
if ![runto_main] then {
- untested altivec-abi.exp
+ untested "could not run to main"
return -1
}
}
if [test_compiler_info gcc*] {
- set saved_prefix $pf_prefix
+ set binprefix ${binfile}
- set pf_prefix "${saved_prefix} default ABI, auto:"
- altivec_abi_tests "additional_flags=-maltivec" "auto"
+ with_test_prefix "default ABI, auto" {
+ altivec_abi_tests "additional_flags=-maltivec" "auto"
+ }
# On GNU/Linux, we can mix -mabi=no-altivec and -mabi=altivec.
# So test some combinations.
# On 64-bit GNU/Linux with GCC 4.1 and 4.2, -mabi=no-altivec
# was broken, so skip those tests there.
if { ![is_lp64_target] || ![test_compiler_info "gcc-4-\[12\]-*"] } {
- set binfile ${objdir}/${subdir}/${testfile}-ge-ge
- set pf_prefix "${saved_prefix} generic ABI, forced:"
- altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=no-altivec" "generic"
-
- set binfile ${objdir}/${subdir}/${testfile}-ge-auto
- set pf_prefix "${saved_prefix} generic ABI, auto:"
- altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=no-altivec" "auto"
+ set binfile ${binprefix}-ge-ge
+ with_test_prefix "generic ABI, forced" {
+ altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=no-altivec" "generic"
+ }
+
+ set binfile ${binprefix}-ge-auto
+ with_test_prefix "generic ABI, auto" {
+ altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=no-altivec" "auto"
+ }
}
- set binfile ${objdir}/${subdir}/${testfile}-av-av
- set pf_prefix "${saved_prefix} AltiVec ABI, forced:"
- altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=altivec" "altivec"
+ set binfile ${binprefix}-av-av
+ with_test_prefix "AltiVec ABI, forced" {
+ altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=altivec" "altivec"
+ }
- set binfile ${objdir}/${subdir}/${testfile}-av-auto
- set pf_prefix "${saved_prefix} AltiVec ABI, auto:"
- altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=altivec" "auto"
+ set binfile ${binprefix}-av-auto
+ with_test_prefix "AltiVec ABI, auto" {
+ altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=altivec" "auto"
+ }
}
} elseif [test_compiler_info xlc*] {
altivec_abi_tests "additional_flags=-qaltivec" "auto"