]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/objc.dg/gnu-encoding/gnu-encoding.exp
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / objc.dg / gnu-encoding / gnu-encoding.exp
CommitLineData
761c0d29 1# GCC Objective-C testsuite that uses the `dg.exp' driver.
8d9254fc 2# Copyright (C) 1997-2020 Free Software Foundation, Inc.
761c0d29
AP
3
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
cd976c16 6# the Free Software Foundation; either version 3 of the License, or
761c0d29
AP
7# (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
cd976c16
NC
15# along with GCC; see the file COPYING3. If not see
16# <http://www.gnu.org/licenses/>.
761c0d29
AP
17
18# Load support procs.
19load_lib objc-dg.exp
4d936aca 20load_lib target-libpath.exp
761c0d29
AP
21
22# If a testcase doesn't have special options, use these.
23global DEFAULT_CFLAGS
24if ![info exists DEFAULT_CFLAGS] then {
25 set DEFAULT_CFLAGS "-fgnu-runtime"
26}
27
28# Initialize `dg'.
29dg-init
30
31#
32# gnu-encoding tests
33#
34set tstobjdir "$tmpdir/objc.dg-struct-layout-encoding-1"
35set generator "$tmpdir/objc.dg-struct-layout-encoding-1_generate"
36
37set generator_src "$srcdir/$subdir/struct-layout-encoding-1_generate.c"
38set generator_src "$generator_src $srcdir/$subdir/generate-random.c"
39set generator_src "$generator_src $srcdir/$subdir/generate-random_r.c"
40set generator_cmd "-o $generator $generator_src"
4d936aca
JJ
41# Temporarily switch to the environment of the host compiler.
42restore_ld_library_path_env_vars
e828d3f3 43set status [remote_exec build "$HOSTCC $HOSTCFLAGS $generator_cmd"]
761c0d29 44set status [lindex $status 0]
4d936aca 45set_ld_library_path_env_vars
761c0d29
AP
46if { $status == 0 } then {
47 file delete -force $tstobjdir
48 file mkdir $tstobjdir
49 set generator_args "-s $srcdir/$subdir -d $tstobjdir"
50# set generator_args "$generator_args -n 15000"
51 set status [remote_exec host "$generator $generator_args"]
52 set status [lindex $status 0]
53 if { $status == 0 } then {
54 foreach src [lsort [find $tstobjdir *_main.m]] {
55 # If we're only testing specific files and this isn't one
56 # of them, skip it.
57 if ![runtest_file_p $runtests $src] then {
58 continue
59 }
60
717c4789 61 gcc_parallel_test_enable 0
761c0d29 62 dg-runtest $src "" $DEFAULT_CFLAGS
717c4789 63 gcc_parallel_test_enable 1
761c0d29
AP
64 }
65 } else {
66 warning "Could not execute objc.dg/gnu-encoding/struct-layout-encoding-1 generator"
67 }
68} else {
69 warning "Could not compile objc.dg/gnu-encoding/struct-layout-encoding-1 generator"
70}
71
72
73
74
75
76
77# All done.
78dg-finish
79