[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gcc.dg / pr31096.c
blob32c979ed69fe4fb487f495a27f4d39af490711d7
1 /* PR middle-end/31096 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-optimized" } */
5 #define signval_pos(name, op) \
6 int name (int a, int b) \
7 { return a * 4 op b * 4; }
9 signval_pos(peq, ==) signval_pos(pne, !=) signval_pos(plt, <)
10 signval_pos(pgt, >) signval_pos(pge, >=) signval_pos(ple, <=)
12 #define signval_neg(name, op) \
13 int name (int a, int b) \
14 { return a * -23 op b * -23; }
16 signval_neg(neq, ==) signval_neg(nne, !=) signval_neg(nlt, <)
17 signval_neg(ngt, >) signval_neg(nge, >=) signval_neg(nle, <=)
19 #define vec_pos(name, op) \
20 int name (int a[10], int b[10]) \
21 { return a[3] * 4 op b[8] * 4; }
23 vec_pos(vpeq, ==) vec_pos(vpne, !=) vec_pos(vplt, <)
24 vec_pos(vpgt, >) vec_pos(vpge, >=) vec_pos(vple, <=)
26 #define vec_neg(name, op) \
27 int name (int a[10], int b[10]) \
28 { return a[3] * -23 op b[8] * -23; }
30 vec_neg(vneq, ==) vec_neg(vnne, !=) vec_neg(vnlt, <)
31 vec_neg(vngt, >) vec_neg(vnge, >=) vec_neg(vnle, <=)
33 /* { dg-final { scan-tree-dump-not "\\(D\\) \\* 4" "optimized" } } */
34 /* { dg-final { scan-tree-dump-not "\\(D\\) \\* -23" "optimized" } } */
35 /* { dg-final { scan-tree-dump-times "_1 = b_2\\(D\\)" 4 "optimized" } } */
36 /* { dg-final { scan-tree-dump-times "_1 = MEM\\\[\\(int \\*\\)b" 4 "optimized" } } */