diff options
author | Stan Shebs <stanshebs@google.com> | 2018-01-24 12:42:41 -0800 |
---|---|---|
committer | Stan Shebs <stanshebs@google.com> | 2018-01-24 16:03:40 -0800 |
commit | 4d954e99e984301fab6890ef9022af0016db39f5 (patch) | |
tree | 32a017fd28c356a176ac3b33835595f051637d17 /conform/conformtest.pl | |
parent | 85ad9efa68af4e841c659234b7c47f4f3816515b (diff) | |
download | glibc-4d954e99e984301fab6890ef9022af0016db39f5.tar.gz |
Add clang and debug support to conformance scripts
Diffstat (limited to 'conform/conformtest.pl')
-rw-r--r-- | conform/conformtest.pl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/conform/conformtest.pl b/conform/conformtest.pl index cb500f0e76..e12e072278 100644 --- a/conform/conformtest.pl +++ b/conform/conformtest.pl @@ -11,7 +11,7 @@ $cross = ""; $xfail_str = ""; GetOptions ('headers=s' => \@headers, 'standard=s' => \$standard, 'flags=s' => \$flags, 'cc=s' => \$CC, 'tmpdir=s' => \$tmpdir, - 'cross' => \$cross, 'xfail=s' => \$xfail_str); + 'cross' => \$cross, 'xfail=s' => \$xfail_str, 'withclang=s' => \$withclang); @headers = split(/,/,join(',',@headers)); # List of the headers we are testing. @@ -270,9 +270,17 @@ sub checknamespace { close (TESTFILE); undef %errors; + if ($withclang eq "yes") { + open (CONTENT, "$CC $CFLAGS_namespace -E $fnamebase.c -P -Wp,-dM | sed -e '/^# [1-9]/d' -e '/^[[:space:]]*\$/d' |"); + } else { open (CONTENT, "$CC $CFLAGS_namespace -E $fnamebase.c -P -Wp,-dN | sed -e '/^# [1-9]/d' -e '/^[[:space:]]*\$/d' |"); + } loop: while (<CONTENT>) { chop; + if ($withclang eq "yes") { + # Filter extra output coming from -dM + s/^(#[^ ]+ [^ (]+).*$/$1/g; + } if (/^#define (.*)/) { newtoken ($1, @allow); } elsif (/^#undef (.*)/) { |