| 1 | // RUN: %clangxx -O2 %s -o %t && %run %t 2>&1 | FileCheck %s |
|---|---|
| 2 | |
| 3 | #include <math.h> |
| 4 | #include <stdio.h> |
| 5 | #include <stdlib.h> |
| 6 | |
| 7 | int main() { |
| 8 | for (int i = 0; i < 10000; i++) { |
| 9 | volatile double x = 10; |
| 10 | int exp = 0; |
| 11 | double y = frexp(x: x, exponent: &exp); |
| 12 | if (y != 0.625 || exp != 4) { |
| 13 | printf(format: "i=%d y=%lf exp=%d\n", i, y, exp); |
| 14 | exit(status: 1); |
| 15 | } |
| 16 | } |
| 17 | fprintf(stderr, format: "DONE\n"); |
| 18 | // CHECK: DONE |
| 19 | return 0; |
| 20 | } |
| 21 |
