void test_complex_long_double(_Complex long double x) {
  (void)abs(x);
  (void)labs(x);
  (void)llabs(x);
  (void)fabsf(x);
  (void)fabs(x);
  (void)fabsl(x);
  (void)cabsf(x);
  (void)cabs(x);
  (void)cabsl(x);
  (void)__builtin_abs(x);
  (void)__builtin_labs(x);
  (void)__builtin_llabs(x);
  (void)__builtin_fabsf(x);
  (void)__builtin_fabs(x);
  (void)__builtin_fabsl(x);
  (void)__builtin_cabsf(x);
  (void)__builtin_cabs(x);
  (void)__builtin_cabsl(x);
}


x86 assembly (clang, -O0):
<test_complex_long_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
lea    0x10(%rbp),%rax
mov    %rax,-0xa8(%rbp)
fldt   (%rax)
fnstcw -0x96(%rbp)
movzwl -0x96(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x98(%rbp)
fldcw  -0x98(%rbp)
fistpl -0x94(%rbp)
fldcw  -0x96(%rbp)
mov    -0x94(%rbp),%edi
call   1030 <abs@plt>
mov    -0xa8(%rbp),%rax
fldt   (%rax)
fnstcw -0x9a(%rbp)
movzwl -0x9a(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x9c(%rbp)
fldcw  -0x9c(%rbp)
fistpll -0x90(%rbp)
fldcw  -0x9a(%rbp)
mov    -0x90(%rbp),%rdi
call   1040 <labs@plt>
mov    -0xa8(%rbp),%rax
fldt   (%rax)
fnstcw -0x9e(%rbp)
movzwl -0x9e(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0xa0(%rbp)
fldcw  -0xa0(%rbp)
fistpll -0x88(%rbp)
fldcw  -0x9e(%rbp)
mov    -0x88(%rbp),%rdi
call   1080 <llabs@plt>
mov    -0xa8(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
fxch   %st(1)
fstps  -0x8(%rbp)
fstps  -0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1070 <cabsf@plt>
mov    -0xa8(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
fxch   %st(1)
fstpl  -0x18(%rbp)
fstpl  -0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1050 <cabs@plt>
mov    -0xa8(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
fxch   %st(1)
fstpt  -0x40(%rbp)
fstpt  -0x30(%rbp)
movaps -0x40(%rbp),%xmm0
movaps -0x30(%rbp),%xmm1
mov    %rsp,%rax
movaps %xmm1,0x10(%rax)
movaps %xmm0,(%rax)
call   1060 <cabsl@plt>
fstp   %st(0)
mov    -0xa8(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
fxch   %st(1)
fstps  -0x48(%rbp)
fstps  -0x44(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1070 <cabsf@plt>
mov    -0xa8(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
fxch   %st(1)
fstpl  -0x58(%rbp)
fstpl  -0x50(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
call   1050 <cabs@plt>
mov    -0xa8(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
fxch   %st(1)
fstpt  -0x80(%rbp)
fstpt  -0x70(%rbp)
lea    -0x80(%rbp),%rax
mov    (%rax),%rcx
mov    %rcx,(%rsp)
mov    0x8(%rax),%rcx
mov    %rcx,0x8(%rsp)
mov    0x10(%rax),%rcx
mov    %rcx,0x10(%rsp)
mov    0x18(%rax),%rax
mov    %rax,0x18(%rsp)
call   1060 <cabsl@plt>
fstp   %st(0)
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_complex_long_double>:
sub    $0xb8,%rsp
fldt   0xc0(%rsp)
fld    %st(0)
fstpt  0x34(%rsp)
fstps  0x24(%rsp)
fldt   0xd0(%rsp)
fld    %st(0)
fstpt  0x28(%rsp)
fstps  0x20(%rsp)
movss  0x20(%rsp),%xmm1
movss  0x24(%rsp),%xmm0
unpcklps %xmm1,%xmm0
movaps %xmm0,0x60(%rsp)
call   1050 <cabsf@plt>
fldt   0x34(%rsp)
fstpl  0x58(%rsp)
movsd  0x58(%rsp),%xmm0
movsd  %xmm0,0x48(%rsp)
fldt   0x28(%rsp)
fstpl  0x50(%rsp)
movsd  0x50(%rsp),%xmm1
movsd  %xmm1,0x40(%rsp)
call   1030 <cabs@plt>
fldt   0x34(%rsp)
fstpt  0x90(%rsp)
fldt   0x28(%rsp)
fstpt  0xa0(%rsp)
movaps 0x90(%rsp),%xmm0
movaps 0xa0(%rsp),%xmm1
movaps %xmm1,0x10(%rsp)
movaps %xmm0,(%rsp)
call   1040 <cabsl@plt>
fstp   %st(0)
movaps 0x60(%rsp),%xmm0
call   1050 <cabsf@plt>
movsd  0x48(%rsp),%xmm0
movsd  0x40(%rsp),%xmm1
call   1030 <cabs@plt>
fldt   0x34(%rsp)
fstpt  0x70(%rsp)
fldt   0x28(%rsp)
fstpt  0x80(%rsp)
movaps 0x70(%rsp),%xmm0
movaps 0x80(%rsp),%xmm1
movaps %xmm1,0x10(%rsp)
movaps %xmm0,(%rsp)
call   1040 <cabsl@plt>
fstp   %st(0)
add    $0xb8,%rsp
ret

LLVM IR (-O0):
define void @test_complex_long_double({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = alloca { float, float }
%3 = alloca { double, double }
%4 = alloca { x86_fp80, x86_fp80 }
%5 = alloca { float, float }
%6 = alloca { double, double }
%7 = alloca { x86_fp80, x86_fp80 }
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%9 = load x86_fp80, x86_fp80* %8
%10 = fptosi x86_fp80 %9 to i32
%11 = call i32 @abs(i32 %10)
%12 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%13 = load x86_fp80, x86_fp80* %12
%14 = fptosi x86_fp80 %13 to i64
%15 = call i64 @labs(i64 %14)
%16 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%17 = load x86_fp80, x86_fp80* %16
%18 = fptosi x86_fp80 %17 to i64
%19 = call i64 @llabs(i64 %18)
%20 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%21 = load x86_fp80, x86_fp80* %20
%22 = fptrunc x86_fp80 %21 to float
%23 = call float @llvm.fabs.f32(float %22)
%24 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%25 = load x86_fp80, x86_fp80* %24
%26 = fptrunc x86_fp80 %25 to double
%27 = call double @llvm.fabs.f64(double %26)
%28 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%29 = load x86_fp80, x86_fp80* %28
%30 = call x86_fp80 @llvm.fabs.f80(x86_fp80 %29)
%31 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%32 = load x86_fp80, x86_fp80* %31
%33 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%34 = load x86_fp80, x86_fp80* %33
%35 = fptrunc x86_fp80 %32 to float
%36 = fptrunc x86_fp80 %34 to float
%37 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%38 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
store float %35, float* %37
store float %36, float* %38
%39 = bitcast { float, float }* %2 to <2 x float>*
%40 = load <2 x float>, <2 x float>* %39
%41 = call float @cabsf(<2 x float> %40)
%42 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%43 = load x86_fp80, x86_fp80* %42
%44 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%45 = load x86_fp80, x86_fp80* %44
%46 = fptrunc x86_fp80 %43 to double
%47 = fptrunc x86_fp80 %45 to double
%48 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%49 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %46, double* %48
store double %47, double* %49
%50 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%51 = load double, double* %50
%52 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%53 = load double, double* %52
%54 = call double @cabs(double %51, double %53)
%55 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%56 = load x86_fp80, x86_fp80* %55
%57 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%58 = load x86_fp80, x86_fp80* %57
%59 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %4, i32 0, i32 0
%60 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %4, i32 0, i32 1
store x86_fp80 %56, x86_fp80* %59
store x86_fp80 %58, x86_fp80* %60
%61 = call x86_fp80 @cabsl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %4)
%62 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%63 = load x86_fp80, x86_fp80* %62
%64 = fptosi x86_fp80 %63 to i32
%65 = sub nsw i32 0, %64
%66 = icmp slt i32 %64, 0
%67 = select i1 %66, i32 %65, i32 %64
%68 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%69 = load x86_fp80, x86_fp80* %68
%70 = fptosi x86_fp80 %69 to i64
%71 = sub nsw i64 0, %70
%72 = icmp slt i64 %70, 0
%73 = select i1 %72, i64 %71, i64 %70
%74 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%75 = load x86_fp80, x86_fp80* %74
%76 = fptosi x86_fp80 %75 to i64
%77 = sub nsw i64 0, %76
%78 = icmp slt i64 %76, 0
%79 = select i1 %78, i64 %77, i64 %76
%80 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%81 = load x86_fp80, x86_fp80* %80
%82 = fptrunc x86_fp80 %81 to float
%83 = call float @llvm.fabs.f32(float %82)
%84 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%85 = load x86_fp80, x86_fp80* %84
%86 = fptrunc x86_fp80 %85 to double
%87 = call double @llvm.fabs.f64(double %86)
%88 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%89 = load x86_fp80, x86_fp80* %88
%90 = call x86_fp80 @llvm.fabs.f80(x86_fp80 %89)
%91 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%92 = load x86_fp80, x86_fp80* %91
%93 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%94 = load x86_fp80, x86_fp80* %93
%95 = fptrunc x86_fp80 %92 to float
%96 = fptrunc x86_fp80 %94 to float
%97 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 0
%98 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 1
store float %95, float* %97
store float %96, float* %98
%99 = bitcast { float, float }* %5 to <2 x float>*
%100 = load <2 x float>, <2 x float>* %99
%101 = call float @cabsf(<2 x float> %100)
%102 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%103 = load x86_fp80, x86_fp80* %102
%104 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%105 = load x86_fp80, x86_fp80* %104
%106 = fptrunc x86_fp80 %103 to double
%107 = fptrunc x86_fp80 %105 to double
%108 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 0
%109 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 1
store double %106, double* %108
store double %107, double* %109
%110 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 0
%111 = load double, double* %110
%112 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 1
%113 = load double, double* %112
%114 = call double @cabs(double %111, double %113)
%115 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%116 = load x86_fp80, x86_fp80* %115
%117 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%118 = load x86_fp80, x86_fp80* %117
%119 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %7, i32 0, i32 0
%120 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %7, i32 0, i32 1
store x86_fp80 %116, x86_fp80* %119
store x86_fp80 %118, x86_fp80* %120
%121 = call x86_fp80 @cabsl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %7)
ret void
}

LLVM IR (-O2):
define void @test_complex_long_double({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = alloca { x86_fp80, x86_fp80 }
%3 = alloca { x86_fp80, x86_fp80 }
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%5 = load x86_fp80, x86_fp80* %4
%6 = fptrunc x86_fp80 %5 to float
%7 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%8 = load x86_fp80, x86_fp80* %7
%9 = fptrunc x86_fp80 %8 to float
%10 = insertelement <2 x float> undef, float %6, i64 0
%11 = insertelement <2 x float> %10, float %9, i64 1
%12 = tail call float @cabsf(<2 x float> %11)
%13 = fptrunc x86_fp80 %5 to double
%14 = fptrunc x86_fp80 %8 to double
%15 = tail call double @cabs(double %13, double %14)
%16 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i64 0, i32 0
%17 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i64 0, i32 1
store x86_fp80 %5, x86_fp80* %16
store x86_fp80 %8, x86_fp80* %17
%18 = tail call x86_fp80 @cabsl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %2)
%19 = tail call float @cabsf(<2 x float> %11)
%20 = tail call double @cabs(double %13, double %14)
%21 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i64 0, i32 0
%22 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i64 0, i32 1
store x86_fp80 %5, x86_fp80* %21
store x86_fp80 %8, x86_fp80* %22
%23 = tail call x86_fp80 @cabsl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %3)
ret void
}