1#! /bin/sh 2 3# Test catching of division by zero in plural expression. 4 5# Note: On AIX 3 with xlc, this test fails. To make it work, add "-qcheck" 6# to the CFLAGS, or use gcc. 7 8tmpfiles="" 9trap 'rm -fr $tmpfiles' 1 2 3 15 10 11tmpfiles="$tmpfiles mf-6.po" 12cat <<EOF > mf-6.po 13msgid "" 14msgstr "" 15"Project-Id-Version: msgfmt test 4\n" 16"PO-Revision-Date: 2001-09-23 15:03+0200\n" 17"Last-Translator: Bruno Haible <haible@clisp.cons.org>\n" 18"Language-Team: test <test@li.org>\n" 19"MIME-Version: 1.0\n" 20"Content-Type: text/plain; charset=ASCII\n" 21"Content-Transfer-Encoding: 8bit\n" 22"Plural-Forms: nplurals=3; plural=(1 + (1 / (n - 257)));\n" 23EOF 24 25tmpfiles="$tmpfiles mf-6.mo core *.core" 26: ${MSGFMT=msgfmt} 27${MSGFMT} --check -o mf-6.mo mf-6.po 2>/dev/null 28# Exit code must be 1. 29# If the division by zero didn't get noticed, it would be 0. 30# If it produced a core dump, it would be 136 (= 128 + SIGFPE). 31test $? = 1 32result=$? 33 34rm -fr $tmpfiles 35 36exit $result 37