2016-12-21 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / c-c++-common / ubsan / float-div-by-zero-1.c
blob2271ea9b7761043b3252b022a3e43a1af0ac9ff4
1 /* { dg-do run } */
2 /* { dg-options "-fsanitize=float-divide-by-zero" } */
4 int
5 main (void)
7 volatile float a = 1.3f;
8 volatile double b = 0.0;
9 volatile int c = 4;
10 volatile float res;
12 res = a / b;
13 res = a / 0.0;
14 res = 2.7f / b;
15 res = 3.6 / (b = 0.0, b);
16 res = c / b;
17 res = b / c;
19 return 0;
22 /* { dg-output "division by zero\[^\n\r]*(\n|\r\n|\r)" } */
23 /* { dg-output "\[^\n\r]*division by zero\[^\n\r]*(\n|\r\n|\r)" } */
24 /* { dg-output "\[^\n\r]*division by zero\[^\n\r]*(\n|\r\n|\r)" } */
25 /* { dg-output "\[^\n\r]*division by zero\[^\n\r]*(\n|\r\n|\r)" } */
26 /* { dg-output "\[^\n\r]*division by zero\[^\n\r]*" } */