libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr109938.c
blobd64ddd6ca611593422e4d7a123b227a77949671a
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-dse2 -Wno-psabi" } */
4 typedef int v4si __attribute__((vector_size(4 * sizeof(int))));
6 /* Generic */
7 __attribute__((noipa)) int
8 t1 (int a, int b, int c)
10 return ((a ^ c) & b) | a;
13 __attribute__((noipa)) unsigned int
14 t2 (int a, unsigned int b, int c)
16 return ((a ^ c) & b) | a;
19 __attribute__((noipa)) unsigned long
20 t3 (unsigned long a, long b, unsigned long c)
22 return ((a ^ c) & b) | a;
25 __attribute__((noipa)) unsigned short
26 t4 (short a, unsigned short b, unsigned short c)
28 return (unsigned short) ((a ^ c) & b) | a;
31 __attribute__((noipa)) unsigned char
32 t5 (unsigned char a, signed char b, signed char c)
34 return ((a ^ c) & b) | a;
37 __attribute__((noipa)) long long
38 t6 (long long a, long long b, long long c)
40 return ((a ^ c) & (unsigned long long) b) | a;
43 /* Gimple */
44 __attribute__((noipa)) int
45 t7 (int a, int b, int c)
47 int t1 = a ^ c;
48 int t2 = t1 & b;
49 int t3 = t2 | a;
50 return t3;
53 __attribute__((noipa)) int
54 t8 (int a, unsigned int b, unsigned int c)
56 unsigned int t1 = a ^ c;
57 int t2 = t1 & b;
58 int t3 = t2 | a;
59 return t3;
62 __attribute__((noipa)) unsigned int
63 t9 (unsigned int a, unsigned int b, int c)
65 unsigned int t1 = a ^ c;
66 unsigned int t2 = t1 & b;
67 unsigned int t3 = t2 | a;
68 return t3;
71 __attribute__((noipa)) unsigned long
72 t10 (unsigned long a, long b, unsigned long c)
74 unsigned long t1 = a ^ c;
75 unsigned long t2 = t1 & b;
76 unsigned long t3 = t2 | a;
77 return t3;
80 __attribute__((noipa)) unsigned short
81 t11 (short a, unsigned short b, short c)
83 short t1 = a ^ c;
84 unsigned short t2 = t1 & b;
85 unsigned short t3 = t2 | a;
86 return t3;
89 __attribute__((noipa)) unsigned char
90 t12 (signed char a, unsigned char b, signed char c)
92 unsigned char t1 = a ^ c;
93 unsigned char t2 = t1 & b;
94 unsigned char t3 = t2 | a;
95 return t3;
98 __attribute__((noipa)) unsigned long long
99 t13 (unsigned long long a, long long b, unsigned long long c)
101 long long t1 = a ^ c;
102 long long t2 = t1 & b;
103 unsigned long long t3 = t2 | a;
104 return t3;
107 /* Vectors */
108 __attribute__((noipa)) v4si
109 t14 (v4si a, v4si b, v4si c)
111 return ((a ^ c) & b) | a;
114 __attribute__((noipa)) v4si
115 t15 (v4si a, v4si b, v4si c)
117 v4si t1 = a ^ c;
118 v4si t2 = t1 & b;
119 v4si t3 = t2 | a;
120 return t3;
123 /* { dg-final { scan-tree-dump-not " \\\^ " "dse2" } } */
124 /* { dg-final { scan-tree-dump-times " \\\| " 15 "dse2" } } */
125 /* { dg-final { scan-tree-dump-times " & " 15 "dse2" } } */