summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/spu/ea/ea.exp
blob: 2e04f9d77b2d8ebd831951e9a6d269bf71fbf3b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#   Copyright (C) 2008-2014 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING3.  If not see
# <http://www.gnu.org/licenses/>.

# GCC testsuite that uses the `dg.exp' driver.

# Exit immediately if this isn't a SPU target.
if { ![istarget spu-*-*] } then {
  return
}

# Load support procs.
load_lib gcc-dg.exp

# Return 1 if target __ea library functions are available
proc check_effective_target_ealib { } {
    return [check_no_compiler_messages ealib executable {
	#include <ea.h>
	int main (void)
	{
	    __ea void *ptr = malloc_ea (1024);
	    return 0;
	}
    }]
}

# If a testcase doesn't have special options, use these.
# We do not use the global DEFAULT_CFLAGS as all test cases
# in this directory use the __ea address space qualifier
# extension and thus will not compile with -ansi.
set DEFAULT_EA_CFLAGS "-std=gnu99 -pedantic-errors -O2"

# Initialize `dg'.
dg-init

# Run all tests in both -mea32 and -mea64 mode.
set tests [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]]
dg-runtest $tests "-mea32" $DEFAULT_EA_CFLAGS
dg-runtest $tests "-mea64" $DEFAULT_EA_CFLAGS

# All done.
dg-finish