void test_long_double_arrays() {
  long double a[10];
  long double *pa = &a;
  int i;
  for (i = 0; i < 10; ++i) {
    *pa = (long double)i;
    pa++;
  }
  pa = &a;
  assertTrue("a[0] == 0", a[0] == 0);
  ;
  assertTrue("a[1] == 1", a[1] == 1);
  ;
  assertTrue("*(pa+9)== 9", *(pa + 9) == 9);
  ;
  assertTrue("a[9] == 9", a[9] == 9);
  ;
}


x86 assembly (clang, -O0):
<test_long_double_arrays>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
lea    -0xa0(%rbp),%rax
mov    %rax,-0xa8(%rbp)
movl   $0x0,-0xac(%rbp)
cmpl   $0xa,-0xac(%rbp)
jge    1181 <test_long_double_arrays+0x71>
mov    -0xac(%rbp),%eax
mov    %eax,-0xb0(%rbp)
fildl  -0xb0(%rbp)
mov    -0xa8(%rbp),%rax
fstpt  (%rax)
mov    -0xa8(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0xa8(%rbp)
mov    -0xac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xac(%rbp)
jmp    1133 <test_long_double_arrays+0x23>
lea    -0xa0(%rbp),%rax
mov    %rax,-0xa8(%rbp)
fldt   -0xa0(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
setnp  %cl
sete   %al
and    %cl,%al
movzbl %al,%esi
lea    0xe57(%rip),%rdi
xor    %eax,%eax
mov    %al,-0xbd(%rbp)
call   1030 <assertTrue@plt>
mov    -0xbd(%rbp),%al
fldt   -0x90(%rbp)
fld1
fucomip %st(1),%st
fstp   %st(0)
setnp  %dl
sete   %cl
and    %dl,%cl
movzbl %cl,%esi
lea    0xe30(%rip),%rdi
call   1030 <assertTrue@plt>
mov    -0xbd(%rbp),%al
mov    -0xa8(%rbp),%rcx
fldt   0x90(%rcx)
flds   0xe04(%rip)
fld    %st(0)
fstpt  -0xbc(%rbp)
fucomip %st(1),%st
fstp   %st(0)
setnp  %dl
sete   %cl
and    %dl,%cl
movzbl %cl,%esi
lea    0xdfe(%rip),%rdi
call   1030 <assertTrue@plt>
fldt   -0xbc(%rbp)
fldt   -0x10(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setnp  %cl
sete   %al
and    %cl,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1030 <assertTrue@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_long_double_arrays>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <assertTrue@plt>
lea    0xedf(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <assertTrue@plt>
lea    0xed6(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <assertTrue@plt>
lea    0xecf(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <assertTrue@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"a[0] == 0\00"
@.str.1 = [10 x i8] c"a[1] == 1\00"
@.str.2 = [12 x i8] c"*(pa+9)== 9\00"
@.str.3 = [10 x i8] c"a[9] == 9\00"
define void @test_long_double_arrays() {
%1 = alloca [10 x x86_fp80]
%2 = alloca x86_fp80*
%3 = alloca i32
%4 = bitcast [10 x x86_fp80]* %1 to x86_fp80*
store x86_fp80* %4, x86_fp80** %2
store i32 0, i32* %3
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to x86_fp80
%11 = load x86_fp80*, x86_fp80** %2
store x86_fp80 %10, x86_fp80* %11
%12 = load x86_fp80*, x86_fp80** %2
%13 = getelementptr inbounds x86_fp80, x86_fp80* %12, i32 1
store x86_fp80* %13, x86_fp80** %2
br label %14
14: ; preds = %8
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %5
17: ; preds = %5
%18 = bitcast [10 x x86_fp80]* %1 to x86_fp80*
store x86_fp80* %18, x86_fp80** %2
%19 = getelementptr inbounds [10 x x86_fp80], [10 x x86_fp80]* %1, i64 0, i64 0
%20 = load x86_fp80, x86_fp80* %19
%21 = fcmp oeq x86_fp80 %20, 0xK00000000000000000000
%22 = zext i1 %21 to i32
%23 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @assertTrue to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds [10 x x86_fp80], [10 x x86_fp80]* %1, i64 0, i64 1
%25 = load x86_fp80, x86_fp80* %24
%26 = fcmp oeq x86_fp80 %25, 0xK3FFF8000000000000000
%27 = zext i1 %26 to i32
%28 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @assertTrue to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = load x86_fp80*, x86_fp80** %2
%30 = getelementptr inbounds x86_fp80, x86_fp80* %29, i64 9
%31 = load x86_fp80, x86_fp80* %30
%32 = fcmp oeq x86_fp80 %31, 0xK40029000000000000000
%33 = zext i1 %32 to i32
%34 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @assertTrue to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %33)
%35 = getelementptr inbounds [10 x x86_fp80], [10 x x86_fp80]* %1, i64 0, i64 9
%36 = load x86_fp80, x86_fp80* %35
%37 = fcmp oeq x86_fp80 %36, 0xK40029000000000000000
%38 = zext i1 %37 to i32
%39 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @assertTrue to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %38)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"a[0] == 0\00"
@.str.1 = [10 x i8] c"a[1] == 1\00"
@.str.2 = [12 x i8] c"*(pa+9)== 9\00"
@.str.3 = [10 x i8] c"a[9] == 9\00"
define void @test_long_double_arrays() {
%1 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @assertTrue to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @assertTrue to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @assertTrue to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @assertTrue to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret void
}