diff options
author | Zack Weinberg <zack@gcc.gnu.org> | 1999-11-13 03:22:35 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 1999-11-13 03:22:35 +0000 |
commit | c2b8394607c151614946193d6a44d752b79a85c1 (patch) | |
tree | b143c93250186de5c7952e34432dd63880edb6fe /gcc | |
parent | 3db377a9b37aa3bccfb4c7df42741314cbd781c9 (diff) | |
download | gcc-c2b8394607c151614946193d6a44d752b79a85c1.zip gcc-c2b8394607c151614946193d6a44d752b79a85c1.tar.gz gcc-c2b8394607c151614946193d6a44d752b79a85c1.tar.bz2 |
Test for optimizer bug with -finline-functions.
Reported by Jim Meyering; distilled from bash.
From-SVN: r30517
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/991112-1.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/991112-1.c b/gcc/testsuite/gcc.c-torture/execute/991112-1.c new file mode 100644 index 0000000..78c1a5e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/991112-1.c @@ -0,0 +1,19 @@ +/* This code was miscompiled at -O3 on x86. + Reported by Jim Myering; distilled from bash. */ + +int rl_show_char (int c) { return 0; } + +int rl_character_len (int c, int pos) +{ + return isprint (c) ? 1 : 2; +} + +int main(void) +{ + int (*x)(int, int) = rl_character_len; + if (x('a', 1) != 1) + abort(); + if (x('\002', 1) != 2) + abort(); + return 0; +} |