Imported Upstream version 4.7.3
[platform/upstream/gcc48.git] / gcc / testsuite / gcc.dg / vect / pr43842.c
1 /* { dg-do compile } */
2
3 typedef char int8_t;
4 typedef short int int16_t;
5 typedef int int32_t;
6 typedef unsigned char uint8_t;
7 typedef unsigned short int uint16_t;
8 typedef unsigned int uint32_t;
9
10 static int16_t
11 safe_rshift_func_int16_t_s_u (int16_t left, unsigned int right)
12 {
13   return left || right >= 1 * 8 ? left : left >> right;
14 }
15
16 static int8_t
17 safe_rshift_func_int8_t_s_u (int8_t left, unsigned int right)
18 {
19   return left || right >= 1 * 8 ? left : left >> right;
20 }
21
22
23 static uint32_t
24 safe_add_func_uint32_t_u_u (uint32_t ui1, uint16_t ui2)
25 {
26   return ui1 + ui2;
27 }
28
29 int16_t g_4;
30 int8_t g_4_8;
31 uint32_t g_9[1];
32 uint32_t g_9_8[2];
33 int161 (void)
34 {
35   int32_t l_2;
36
37   for (l_2 = -25; l_2; l_2 = safe_add_func_uint32_t_u_u (l_2, 1))
38     g_9[0] ^= safe_rshift_func_int16_t_s_u (g_4, 1);
39 }
40
41 int81 (void)
42 {
43   int32_t l_2;
44
45   for (l_2 = -25; l_2; l_2 = safe_add_func_uint32_t_u_u (l_2, 1))
46     {
47       g_9[0] ^= safe_rshift_func_int8_t_s_u (g_4_8, 1);
48       g_9[1] ^= safe_rshift_func_int8_t_s_u (g_4_8, 1);
49     }
50
51   return 0;
52 }
53
54 /* { dg-final { cleanup-tree-dump "vect" } } */
55