brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 212ff00 Raw
76 lines · c
1// REQUIRES: arm-registered-target2// RUN: %clang_cc1 -triple arm-unknown-linux-gnueabi -emit-llvm -o - %s | FileCheck %s3 4int printf(const char *, ...);5void exit(int);6 7float frexpf(float, int*);8double frexp(double, int*);9long double frexpl(long double, int*);10 11// CHECK: declare i32 @printf(ptr noundef, ...)12void f0() {13  printf("a\n");14}15 16// CHECK: call void @exit17// CHECK: unreachable18void f1() {19  exit(1);20}21 22// CHECK: call ptr @strstr{{.*}} [[NUW:#[0-9]+]]23char* f2(char* a, char* b) {24  return __builtin_strstr(a, b);25}26 27// Note: Use asm label to disable intrinsic lowering of modf.28double modf(double x, double*) asm("modf");29float modff(float x, float*) asm("modff");30long double modfl(long double x, long double*) asm("modfl");31 32// frexp is NOT readnone. It writes to its pointer argument.33//34// CHECK: f335// CHECK: call double @frexp(double noundef %36// CHECK-NOT: readnone37// CHECK: call float @frexpf(float noundef %38// CHECK-NOT: readnone39// CHECK: call double @frexpl(double noundef %40// CHECK-NOT: readnone41//42// Same thing for modf and friends.43//44// CHECK: call double @modf(double noundef %45// CHECK-NOT: readnone46// CHECK: call float @modff(float noundef %47// CHECK-NOT: readnone48// CHECK: call double @modfl(double noundef %49// CHECK-NOT: readnone50//51// CHECK: call double @remquo(double noundef %52// CHECK-NOT: readnone53// CHECK: call float @remquof(float noundef %54// CHECK-NOT: readnone55// CHECK: call double @remquol(double noundef %56// CHECK-NOT: readnone57// CHECK: ret58int f3(double x) {59  int e;60  float f;61  double d;62  long double ld;63  frexp(x, &e);64  frexpf(x, &e);65  frexpl(x, &e);66  modf(x, &d);67  modff(x, &f);68  modfl(x, &ld);69  __builtin_remquo(x, x, &e);70  __builtin_remquof(x, x, &e);71  __builtin_remquol(x, x, &e);72  return e;73}74 75// CHECK: attributes [[NUW]] = { nounwind{{.*}} }76