Home | History | Annotate | Download | only in CodeGen
      1 // REQUIRES: arm-registered-target
      2 // RUN: %clang_cc1 -triple arm-unknown-linux-gnueabi -emit-llvm -o - %s | FileCheck %s
      3 
      4 // CHECK: declare i32 @printf(i8*, ...)
      5 void f0() {
      6   printf("a\n");
      7 }
      8 
      9 // CHECK: call void @exit
     10 // CHECK: unreachable
     11 void f1() {
     12   exit(1);
     13 }
     14 
     15 // CHECK: call i8* @strstr{{.*}} [[NUW:#[0-9]+]]
     16 char* f2(char* a, char* b) {
     17   return __builtin_strstr(a, b);
     18 }
     19 
     20 // frexp is NOT readnone. It writes to its pointer argument.
     21 // <rdar://problem/10070234>
     22 //
     23 // CHECK: f3
     24 // CHECK: call double @frexp(double %
     25 // CHECK-NOT: readnone
     26 // CHECK: call float @frexpf(float %
     27 // CHECK-NOT: readnone
     28 // CHECK: call double @frexpl(double %
     29 // CHECK-NOT: readnone
     30 //
     31 // Same thing for modf and friends.
     32 //
     33 // CHECK: call double @modf(double %
     34 // CHECK-NOT: readnone
     35 // CHECK: call float @modff(float %
     36 // CHECK-NOT: readnone
     37 // CHECK: call double @modfl(double %
     38 // CHECK-NOT: readnone
     39 //
     40 // CHECK: call double @remquo(double %
     41 // CHECK-NOT: readnone
     42 // CHECK: call float @remquof(float %
     43 // CHECK-NOT: readnone
     44 // CHECK: call double @remquol(double %
     45 // CHECK-NOT: readnone
     46 // CHECK: ret
     47 int f3(double x) {
     48   int e;
     49   __builtin_frexp(x, &e);
     50   __builtin_frexpf(x, &e);
     51   __builtin_frexpl(x, &e);
     52   __builtin_modf(x, &e);
     53   __builtin_modff(x, &e);
     54   __builtin_modfl(x, &e);
     55   __builtin_remquo(x, x, &e);
     56   __builtin_remquof(x, x, &e);
     57   __builtin_remquol(x, x, &e);
     58   return e;
     59 }
     60 
     61 // CHECK: attributes [[NUW]] = { nounwind{{.*}} }
     62