aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CIR/CodeGen/builtins-floating-point.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CIR/CodeGen/builtins-floating-point.c')
-rw-r--r--clang/test/CIR/CodeGen/builtins-floating-point.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/clang/test/CIR/CodeGen/builtins-floating-point.c b/clang/test/CIR/CodeGen/builtins-floating-point.c
index 193cc172..1b7de65 100644
--- a/clang/test/CIR/CodeGen/builtins-floating-point.c
+++ b/clang/test/CIR/CodeGen/builtins-floating-point.c
@@ -7,14 +7,42 @@
float cosf(float f) {
return __builtin_cosf(f);
- // CHECK: %{{.*}} = cir.cos {{.*}} : !cir.float
+ // CIR: %{{.*}} = cir.cos %{{.*}} : !cir.float
// LLVM: %{{.*}} = call float @llvm.cos.f32(float %{{.*}})
// OGCG: %{{.*}} = call float @llvm.cos.f32(float %{{.*}})
}
double cos(double f) {
return __builtin_cos(f);
- // CIR: {{.+}} = cir.cos {{.+}} : !cir.double
+ // CIR: %{{.*}} = cir.cos %{{.*}} : !cir.double
// LLVM: %{{.*}} = call double @llvm.cos.f64(double %{{.*}})
// OGCG: %{{.*}} = call double @llvm.cos.f64(double %{{.*}})
}
+
+float ceil(float f) {
+ return __builtin_ceilf(f);
+ // CIR: %{{.*}} = cir.ceil %{{.*}} : !cir.float
+ // LLVM: %{{.*}} = call float @llvm.ceil.f32(float %{{.*}})
+ // OGCG: %{{.*}} = call float @llvm.ceil.f32(float %{{.*}})
+}
+
+float expf(float f) {
+ return __builtin_expf(f);
+ // CIR: %{{.*}} = cir.exp {{.*}} : !cir.float
+ // LLVM: %{{.*}} = call float @llvm.exp.f32(float %{{.*}})
+ // OGCG: %{{.*}} = call float @llvm.exp.f32(float %{{.*}})
+}
+
+double exp(double f) {
+ return __builtin_exp(f);
+ // CIR: %{{.*}} = cir.exp {{.*}} : !cir.double
+ // LLVM: %{{.*}} = call double @llvm.exp.f64(double %{{.*}})
+ // OGCG: %{{.*}} = call double @llvm.exp.f64(double %{{.*}})
+}
+
+long double expl(long double f) {
+ return __builtin_expl(f);
+ // CIR: %{{.*}} = cir.exp {{.*}} : !cir.long_double<!cir.f128>
+ // LLVM: %{{.*}} = call fp128 @llvm.exp.f128(fp128 %{{.*}})
+ // OGCG: %{{.*}} = call fp128 @llvm.exp.f128(fp128 %{{.*}})
+}