3 # Test recognition of GCC internal format strings.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles
="$tmpfiles f-gi-1.data"
9 cat <<\EOF
> f-gi-1.data
12 # Valid: one character argument
14 # Valid: one string argument
16 # Valid: one integer argument
18 # Valid: one integer argument
20 # Valid: one integer argument
22 # Valid: one integer argument
24 # Valid: one integer argument
26 # Valid: one integer and one string argument
28 # Valid: one pointer argument
30 # Valid: one pointer argument
32 # Valid: one pointer argument
34 # Valid: one pointer argument
36 # Valid: one pointer argument
38 # Valid: one pointer argument
40 # Valid: one pointer argument
42 # Valid: one pointer argument
44 # Valid: one pointer argument
46 # Valid: one pointer argument
48 # Valid: one pointer argument
50 # Valid: one pointer argument
52 # Valid: one argument with flags
54 # Valid: one argument with size specifier
56 # Invalid: unterminated
58 # Invalid: unknown format specifier
60 # Invalid: precision with non-string
62 # Invalid: twice precision
64 # Valid: three arguments
66 # Invalid: a numbered argument
70 : ${XGETTEXT=xgettext}
72 while read comment
; do
75 tmpfiles
="$tmpfiles f-gi-1-$n.in f-gi-1-$n.po"
76 cat <<EOF > f-gi-1-$n.in
79 ${XGETTEXT} -L GCC-source
-o f-gi-1-
$n.po f-gi-1-
$n.
in ||
exit 1
80 test -f f-gi-1-
$n.po ||
exit 1
82 if echo "$comment" |
grep 'Valid:' > /dev
/null
; then
83 if grep gcc-internal-format f-gi-1-
$n.po
> /dev
/null
; then
89 if grep gcc-internal-format f-gi-1-
$n.po
> /dev
/null
; then
95 if test -n "$fail"; then
96 echo "Format string recognition error:" 1>&2
102 rm -f f-gi-1-
$n.
in f-gi-1-
$n.po