RISC-V: Add testcases for unsigned .SAT_ADD vector form 8
[official-gcc.git] / gcc / testsuite / gcc.dg / pr51481.c
bloba35f8f3875103b1e9874231a34b5b7bc56f2fba6
1 /* PR tree-optimization/51481 */
2 /* { dg-do compile } */
3 /* { dg-options "-O -fexceptions -fipa-cp -fipa-cp-clone" } */
4 /* { dg-require-effective-target exceptions } */
6 extern const unsigned short int **foo (void)
7 __attribute__ ((__nothrow__, __const__));
8 struct S { unsigned short s1; int s2; };
9 extern struct S *s[26];
11 void
12 bar (int x, struct S *y, ...)
14 static struct S *t;
15 __builtin_va_list ap;
16 __builtin_va_start (ap, y);
17 if (t != s[7])
19 const char *p = "aAbBc";
20 t = s[7];
21 while ((*foo ())[(unsigned char) *p])
22 p++;
24 __builtin_printf (x == 0 ? "abc\n" : "def\n");
25 if (y != 0)
26 __builtin_printf ("ghi %d %d", y->s2, y->s1);
27 __builtin_va_end (ap);
30 void
31 baz (char *x)
33 bar (1, 0, x);