]> granicus.if.org Git - clang/commitdiff
[CodeGen] add tests for __builtin_sqrt*; NFC
authorSanjay Patel <spatel@rotateright.com>
Fri, 20 Oct 2017 23:32:41 +0000 (23:32 +0000)
committerSanjay Patel <spatel@rotateright.com>
Fri, 20 Oct 2017 23:32:41 +0000 (23:32 +0000)
I don't know if this is correct, but this is what we currently do.
More discussion in PR27108 and PR27435 and D27618.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316250 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/builtins.c

index 3584585de8ccefc42d052b5b5ef6d467faf124a0..86bee451ecb42992da348fadbd410e5d3d5b5160 100644 (file)
@@ -317,6 +317,15 @@ void test_float_builtin_ops(float F, double D, long double LD) {
   resld = __builtin_floorl(LD);
   // CHECK: call x86_fp80 @llvm.floor.f80
 
+  resf = __builtin_sqrtf(F);
+  // CHECK: call float @sqrtf(
+
+  resd = __builtin_sqrt(D);
+  // CHECK: call double @sqrt(
+
+  resld = __builtin_sqrtl(LD);
+  // CHECK: call x86_fp80 @sqrtl(
+
   resf = __builtin_truncf(F);
   // CHECK: call float @llvm.trunc.f32