brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · a4307c5 Raw
70 lines · c
1// RUN: %clang_cc1 -triple aarch64-none-linux-android24 -Wno-unused-value -fclangir -emit-cir %s -o %t.cir2// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR3// RUN: %clang_cc1 -triple aarch64-none-linux-android24 -Wno-unused-value -fclangir -emit-llvm %s -o %t-cir.ll4// RUN: FileCheck --input-file=%t-cir.ll %s -check-prefix=LLVM5// RUN: %clang_cc1 -triple aarch64-none-linux-android24 -Wno-unused-value -emit-llvm %s -o %t.ll6// RUN: FileCheck --input-file=%t.ll %s -check-prefix=OGCG7 8float cosf(float f) {9  return __builtin_cosf(f);10  // CIR: %{{.*}} = cir.cos %{{.*}} : !cir.float11  // LLVM: %{{.*}} = call float @llvm.cos.f32(float %{{.*}})12  // OGCG: %{{.*}} = call float @llvm.cos.f32(float %{{.*}})13}14 15double cos(double f) {16  return __builtin_cos(f);17  // CIR: %{{.*}} = cir.cos %{{.*}} : !cir.double18  // LLVM: %{{.*}} = call double @llvm.cos.f64(double %{{.*}})19  // OGCG: %{{.*}} = call double @llvm.cos.f64(double %{{.*}})20}21 22float ceil(float f) {23  return __builtin_ceilf(f);24  // CIR: %{{.*}} = cir.ceil %{{.*}} : !cir.float25  // LLVM: %{{.*}} = call float @llvm.ceil.f32(float %{{.*}})26  // OGCG: %{{.*}} = call float @llvm.ceil.f32(float %{{.*}})27}28 29float expf(float f) {30  return __builtin_expf(f);31  // CIR: %{{.*}} = cir.exp {{.*}} : !cir.float32  // LLVM: %{{.*}} = call float @llvm.exp.f32(float %{{.*}})33  // OGCG: %{{.*}} = call float @llvm.exp.f32(float %{{.*}})34}35 36double exp(double f) {37  return __builtin_exp(f);38  // CIR: %{{.*}} = cir.exp {{.*}} : !cir.double39  // LLVM: %{{.*}} = call double @llvm.exp.f64(double %{{.*}})40  // OGCG: %{{.*}} = call double @llvm.exp.f64(double %{{.*}})41}42 43long double expl(long double f) {44  return __builtin_expl(f);45  // CIR: %{{.*}} = cir.exp {{.*}} : !cir.long_double<!cir.f128>46  // LLVM: %{{.*}} = call fp128 @llvm.exp.f128(fp128 %{{.*}})47  // OGCG: %{{.*}} = call fp128 @llvm.exp.f128(fp128 %{{.*}})48}49 50float exp2f(float f) {51  return __builtin_exp2f(f);52  // CIR: %{{.*}} = cir.exp2 {{.*}} : !cir.float53  // LLVM: %{{.*}} = call float @llvm.exp2.f32(float %{{.*}})54  // OGCG: %{{.*}} = call float @llvm.exp2.f32(float %{{.*}})55}56 57double my_exp2(double f) {58  return __builtin_exp2(f);59  // CIR: %{{.*}} = cir.exp2 {{.*}} : !cir.double60  // LLVM: %{{.*}} = call double @llvm.exp2.f64(double %{{.*}})61  // OGCG: %{{.*}} = call double @llvm.exp2.f64(double %{{.*}})62}63 64long double my_exp2l(long double f) {65  return __builtin_exp2l(f);66  // CIR: %{{.*}} = cir.exp2 {{.*}} : !cir.long_double<!cir.f128>67  // LLVM: %{{.*}} = call fp128 @llvm.exp2.f128(fp128 %{{.*}})68  // OGCG: %{{.*}} = call fp128 @llvm.exp2.f128(fp128 %{{.*}})69}70