void testComplexFloat(_Atomic(_Complex float) *fp) {
  __c11_atomic_init(fp, 1.0f);
  _Atomic(_Complex float) x = 2.0f;
  _Complex float f = *fp;
  *fp = f;
}


x86 assembly (clang, -O0):
<testComplexFloat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x3f800000,(%rax)
movl   $0x0,0x4(%rax)
movl   $0x40000000,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
movss  -0x20(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
movss  %xmm1,-0x18(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  -0x18(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rcx
movss  %xmm1,-0x28(%rbp)
movss  %xmm0,-0x24(%rbp)
mov    -0x28(%rbp),%rax
xchg   %rax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<testComplexFloat>:
movq   $0x3f800000,(%rdi)
mov    (%rdi),%rax
xchg   %rax,(%rdi)
ret

LLVM IR (-O0):
define void @testComplexFloat({ float, float }* %0) {
%2 = alloca { float, float }*
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = alloca { float, float }
%6 = alloca { float, float }
store { float, float }* %0, { float, float }** %2
%7 = load { float, float }*, { float, float }** %2
%8 = getelementptr inbounds { float, float }, { float, float }* %7, i32 0, i32 0
%9 = getelementptr inbounds { float, float }, { float, float }* %7, i32 0, i32 1
store float 1.000000e+00, float* %8
store float 0.000000e+00, float* %9
%10 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%11 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float 2.000000e+00, float* %10
store float 0.000000e+00, float* %11
%12 = load { float, float }*, { float, float }** %2
%13 = bitcast { float, float }* %12 to i64*
%14 = load atomic i64, i64* %13 seq_cst
%15 = bitcast { float, float }* %5 to i64*
store i64 %14, i64* %15
%16 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 0
%17 = load float, float* %16
%18 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 1
%19 = load float, float* %18
%20 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%21 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
store float %17, float* %20
store float %19, float* %21
%22 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%23 = load float, float* %22
%24 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
%25 = load float, float* %24
%26 = load { float, float }*, { float, float }** %2
%27 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 0
%28 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 1
store float %23, float* %27
store float %25, float* %28
%29 = bitcast { float, float }* %6 to i64*
%30 = load i64, i64* %29
%31 = bitcast { float, float }* %26 to i64*
store atomic i64 %30, i64* %31 seq_cst
ret void
}

LLVM IR (-O2):
define void @testComplexFloat({ float, float }* nocapture %0) {
%2 = getelementptr inbounds { float, float }, { float, float }* %0, i64 0, i32 0
%3 = getelementptr inbounds { float, float }, { float, float }* %0, i64 0, i32 1
store float 1.000000e+00, float* %2
store float 0.000000e+00, float* %3
%4 = bitcast { float, float }* %0 to i64*
%5 = load atomic i64, i64* %4 seq_cst
store atomic i64 %5, i64* %4 seq_cst
ret void
}