testsuite: Add testcase for already fixed PR [PR97960]
This testcase has been fixed by r11-5904-g4cf70c20cb10acd6fb1016611d05540728176b60 so I'm checking it in so that we can close the PR. 2021-02-02 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/97960 * g++.dg/torture/pr97960.C: New test.
This commit is contained in:
parent
bc7c2b34c3
commit
eedda4e160
30
gcc/testsuite/g++.dg/torture/pr97960.C
Normal file
30
gcc/testsuite/g++.dg/torture/pr97960.C
Normal file
@ -0,0 +1,30 @@
|
||||
// PR tree-optimization/97960
|
||||
// { dg-do run }
|
||||
|
||||
#if __CHAR_BIT__ == 8 && __SIZEOF_INT__ == 4
|
||||
const int &
|
||||
foo (const int &d, const int &f)
|
||||
{
|
||||
if (d < f)
|
||||
return f;
|
||||
return d;
|
||||
}
|
||||
|
||||
short a[575];
|
||||
unsigned b[25];
|
||||
unsigned char g;
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
#if __CHAR_BIT__ == 8 && __SIZEOF_INT__ == 4
|
||||
for (int e = 0; e < 23; ++e)
|
||||
a[e * 23] = 16137;
|
||||
for (signed char h = (unsigned char) (foo (g, 253) + 3); h < 24; h++)
|
||||
b[h] = 1064739102;
|
||||
for (int e = 0; e < 23; ++e)
|
||||
if (a[e * 23] != 16137)
|
||||
__builtin_abort ();
|
||||
#endif
|
||||
}
|
Loading…
Reference in New Issue
Block a user