Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / pr104992.c
blob82f8c75559ca0338958c6a3934e42a504f047264
1 /* PR tree-optimization/104992 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -Wno-psabi -fdump-tree-optimized" } */
5 #define vector __attribute__((vector_size(4*sizeof(int))))
7 /* Form from PR. */
8 __attribute__((noipa)) unsigned foo(unsigned x, unsigned y)
10 return x / y * y == x;
13 __attribute__((noipa)) unsigned bar(unsigned x, unsigned y) {
14 return x == x / y * y;
17 /* Signed test case. */
18 __attribute__((noipa)) unsigned baz (int x, int y) {
19 return x / y * y == x;
22 /* Changed order. */
23 __attribute__((noipa)) unsigned qux (unsigned x, unsigned y) {
24 return y * (x / y) == x;
27 /* Test for forward propogation. */
28 __attribute__((noipa)) unsigned corge(unsigned x, unsigned y) {
29 int z = x / y;
30 int q = z * y;
31 return q == x;
34 /* Test vector case. */
35 __attribute__((noipa)) vector int thud(vector int x, vector int y) {
36 return x / y * y == x;
39 /* Complex type should not simplify because mod is different. */
40 __attribute__((noipa)) int goo(_Complex int x, _Complex int y)
42 _Complex int z = x / y;
43 _Complex int q = z * y;
44 return q == x;
47 /* Wrong order. */
48 __attribute__((noipa)) unsigned fred (unsigned x, unsigned y) {
49 return y * x / y == x;
52 /* Wrong pattern. */
53 __attribute__((noipa)) unsigned waldo (unsigned x, unsigned y, unsigned z) {
54 return x / y * z == x;
57 /* { dg-final { scan-tree-dump-times " % " 9 "optimized" { target { ! vect_int_mod } } } } */
58 /* { dg-final { scan-tree-dump-times " % " 6 "optimized" { target vect_int_mod } } } */