Fix broken MinGW build of gcc.c
[official-gcc.git] / gcc / testsuite / gcc.dg / bad-binary-ops.c
blobe1da4d615eedac9526170821a480f3d436d82fb4
1 /* { dg-options "-fdiagnostics-show-caret" } */
3 /* Adapted from https://gcc.gnu.org/wiki/ClangDiagnosticsComparison */
5 typedef float __m128;
6 void test_1 ()
8 __m128 myvec[2];
9 int const *ptr;
10 myvec[1]/ptr; /* { dg-error "invalid operands to binary /" } */
12 /* TODO: ideally we'd underline "ptr" as well.
13 { dg-begin-multiline-output "" }
14 myvec[1]/ptr;
15 ~~~~~~~~^
16 { dg-end-multiline-output "" } */
21 struct s {};
22 struct t {};
23 extern struct s some_function (void);
24 extern struct t some_other_function (void);
26 int test_2 (void)
28 return (some_function ()
29 + some_other_function ()); /* { dg-error "invalid operands to binary \+" } */
31 /* { dg-begin-multiline-output "" }
32 return (some_function ()
33 ~~~~~~~~~~~~~~~~
34 + some_other_function ());
35 ^ ~~~~~~~~~~~~~~~~~~~~~~
36 { dg-end-multiline-output "" } */
39 int test_3 (struct s param_s, struct t param_t)
41 return param_s + param_t; // { dg-error "invalid operands to binary \+" }
43 /* { dg-begin-multiline-output "" }
44 return param_s + param_t;
46 { dg-end-multiline-output "" } */
47 /* TODO: ideally we'd underline both params here. */