brintos

brintos / llvm-project-archived public Read only

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