test_sizeof() {
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/"
          "union.c",
          26, 4, sizeof(union {
            char a;
            int b;
          }));
  ;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/"
          "union.c",
          27, 8, sizeof(union {
            double a;
            int b;
          }));
  ;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/"
          "union.c",
          28, 8, sizeof(union {
            _Alignas(8) char a;
            int b;
          }));
  ;
}


x86 assembly (clang, -O0):
<test_sizeof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x1a,%esi
mov    $0x4,%edx
mov    $0x4,%ecx
mov    $0x0,%al
call   1030 <fexpect@plt>
lea    0xec4(%rip),%rdi
mov    $0x1b,%esi
mov    $0x8,%edx
mov    $0x8,%ecx
mov    $0x0,%al
call   1030 <fexpect@plt>
lea    0xea7(%rip),%rdi
mov    $0x1c,%esi
mov    $0x8,%edx
mov    $0x8,%ecx
mov    $0x0,%al
call   1030 <fexpect@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sizeof>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    $0x4,%ecx
mov    %rbx,%rdi
mov    $0x1a,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <fexpect@plt>
mov    $0x8,%ecx
mov    %rbx,%rdi
mov    $0x1b,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <fexpect@plt>
mov    $0x8,%ecx
mov    %rbx,%rdi
mov    $0x1c,%esi
mov    $0x8,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/union.c\00"
define i32 @test_sizeof() {
%1 = alloca i32
%2 = call i32 (i8*, i32, i32, i64, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i64, ...)*)(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 26, i32 4, i64 4)
%3 = call i32 (i8*, i32, i32, i64, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i64, ...)*)(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 27, i32 8, i64 8)
%4 = call i32 (i8*, i32, i32, i64, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i64, ...)*)(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 28, i32 8, i64 8)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/union.c\00"
define i32 @test_sizeof() {
%1 = tail call i32 (i8*, i32, i32, i64, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i64, ...)*)(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 26, i32 4, i64 4)
%2 = tail call i32 (i8*, i32, i32, i64, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i64, ...)*)(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 27, i32 8, i64 8)
%3 = tail call i32 (i8*, i32, i32, i64, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i64, ...)*)(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 28, i32 8, i64 8)
ret i32 undef
}