void test_builtin_cpow(_Complex double d1, _Complex double d2) {
  if (__builtin_cpow(d1, d2) != __builtin_cpow(d1, d2))
    link_failure_builtin_cpow();
}


x86 assembly (clang, -O0):
<test_builtin_cpow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm2
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  %xmm3,-0x40(%rbp)
movsd  %xmm2,-0x38(%rbp)
movsd  -0x40(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm3
call   1030 <cpow@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  %xmm1,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm3
movsd  -0x18(%rbp),%xmm2
movsd  %xmm1,-0x50(%rbp)
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  %xmm3,-0x60(%rbp)
movsd  %xmm2,-0x58(%rbp)
movsd  -0x60(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm3
call   1030 <cpow@plt>
movsd  -0x70(%rbp),%xmm2
movaps %xmm0,%xmm3
movaps %xmm1,%xmm0
movsd  -0x68(%rbp),%xmm1
ucomisd %xmm3,%xmm2
setne  %al
setp   %cl
or     %cl,%al
ucomisd %xmm0,%xmm1
setne  %cl
setp   %dl
or     %dl,%cl
or     %cl,%al
test   $0x1,%al
jne    11ff <test_builtin_cpow+0xdf>
jmp    1206 <test_builtin_cpow+0xe6>
mov    $0x0,%al
call   1040 <link_failure_builtin_cpow@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_cpow>:
sub    $0x38,%rsp
movsd  %xmm3,0x28(%rsp)
movsd  %xmm2,0x20(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <cpow@plt>
movsd  %xmm0,0x30(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
movsd  0x28(%rsp),%xmm3
call   1030 <cpow@plt>
movsd  0x30(%rsp),%xmm2
ucomisd %xmm0,%xmm2
jne    118b <test_builtin_cpow+0x6b>
jp     118b <test_builtin_cpow+0x6b>
movsd  0x8(%rsp),%xmm0
ucomisd %xmm1,%xmm0
jne    118b <test_builtin_cpow+0x6b>
jp     118b <test_builtin_cpow+0x6b>
add    $0x38,%rsp
ret
xor    %eax,%eax
add    $0x38,%rsp
jmp    1040 <link_failure_builtin_cpow@plt>

LLVM IR (-O0):
define void @test_builtin_cpow(double %0, double %1, double %2, double %3) {
%5 = alloca { double, double }
%6 = alloca { double, double }
%7 = alloca { double, double }
%8 = alloca { double, double }
%9 = alloca { double, double }
%10 = alloca { double, double }
%11 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
store double %0, double* %11
%12 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
store double %1, double* %12
%13 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 0
store double %2, double* %13
%14 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 1
store double %3, double* %14
%15 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%16 = load double, double* %15
%17 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
%18 = load double, double* %17
%19 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 0
%20 = load double, double* %19
%21 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 1
%22 = load double, double* %21
%23 = getelementptr inbounds { double, double }, { double, double }* %7, i32 0, i32 0
%24 = getelementptr inbounds { double, double }, { double, double }* %7, i32 0, i32 1
store double %16, double* %23
store double %18, double* %24
%25 = getelementptr inbounds { double, double }, { double, double }* %7, i32 0, i32 0
%26 = load double, double* %25
%27 = getelementptr inbounds { double, double }, { double, double }* %7, i32 0, i32 1
%28 = load double, double* %27
%29 = getelementptr inbounds { double, double }, { double, double }* %8, i32 0, i32 0
%30 = getelementptr inbounds { double, double }, { double, double }* %8, i32 0, i32 1
store double %20, double* %29
store double %22, double* %30
%31 = getelementptr inbounds { double, double }, { double, double }* %8, i32 0, i32 0
%32 = load double, double* %31
%33 = getelementptr inbounds { double, double }, { double, double }* %8, i32 0, i32 1
%34 = load double, double* %33
%35 = call { double, double } @cpow(double %26, double %28, double %32, double %34)
%36 = extractvalue { double, double } %35, 0
%37 = extractvalue { double, double } %35, 1
%38 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%39 = load double, double* %38
%40 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
%41 = load double, double* %40
%42 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 0
%43 = load double, double* %42
%44 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 1
%45 = load double, double* %44
%46 = getelementptr inbounds { double, double }, { double, double }* %9, i32 0, i32 0
%47 = getelementptr inbounds { double, double }, { double, double }* %9, i32 0, i32 1
store double %39, double* %46
store double %41, double* %47
%48 = getelementptr inbounds { double, double }, { double, double }* %9, i32 0, i32 0
%49 = load double, double* %48
%50 = getelementptr inbounds { double, double }, { double, double }* %9, i32 0, i32 1
%51 = load double, double* %50
%52 = getelementptr inbounds { double, double }, { double, double }* %10, i32 0, i32 0
%53 = getelementptr inbounds { double, double }, { double, double }* %10, i32 0, i32 1
store double %43, double* %52
store double %45, double* %53
%54 = getelementptr inbounds { double, double }, { double, double }* %10, i32 0, i32 0
%55 = load double, double* %54
%56 = getelementptr inbounds { double, double }, { double, double }* %10, i32 0, i32 1
%57 = load double, double* %56
%58 = call { double, double } @cpow(double %49, double %51, double %55, double %57)
%59 = extractvalue { double, double } %58, 0
%60 = extractvalue { double, double } %58, 1
%61 = fcmp une double %36, %59
%62 = fcmp une double %37, %60
%63 = or i1 %61, %62
br i1 %63, label %64, label %66
64: ; preds = %4
%65 = call i32 (...) @link_failure_builtin_cpow()
br label %66
66: ; preds = %64, %4
ret void
}

LLVM IR (-O2):
define void @test_builtin_cpow(double %0, double %1, double %2, double %3) {
%5 = tail call { double, double } @cpow(double %0, double %1, double %2, double %3)
%6 = extractvalue { double, double } %5, 0
%7 = extractvalue { double, double } %5, 1
%8 = tail call { double, double } @cpow(double %0, double %1, double %2, double %3)
%9 = extractvalue { double, double } %8, 0
%10 = extractvalue { double, double } %8, 1
%11 = fcmp une double %6, %9
%12 = fcmp une double %7, %10
%13 = or i1 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %4
%15 = tail call i32 (...) @link_failure_builtin_cpow()
br label %16
16: ; preds = %14, %4
ret void
}