blob: 6d17fd05cc1b7856b36e2cbf6133aa5631bdb8d9 [file] [log] [blame]
Kevin O'Connor231f7102009-01-25 16:11:27 -05001#!/bin/sh
2# Script to test if gcc's -combine option works properly.
3
4TMPFILE1=out/tmp_testcompile1.c
5TMPFILE2=out/tmp_testcompile.o
6
7mkdir -p out
8cat - > $TMPFILE1 <<EOF
9struct ts { union { int u1; struct { int u2; }; }; };
10void t1(struct ts *r);
11EOF
12
13$CC -c -fwhole-program -combine $TMPFILE1 $TMPFILE1 -o $TMPFILE2 > /dev/null 2>&1
14
15if [ $? -eq 0 ]; then
16 #echo " Setting AVOIDCOMBINE=0" > /dev/fd/2
17 echo 0
18else
19 echo " Enabling AVOIDCOMBINE=1" > /dev/fd/2
20 echo 1
21fi
22
23rm -f $TMPFILE1 $TMPFILE2