// File: dsharlet[P]array/test/array_ref.cpp
// Function: nda::test_array_ref_empty_body()
TEST(array_ref_empty) {
  dense_array_ref<int, 1> null_ref(nullptr, {10});
  ASSERT(null_ref.empty());
  null_ref.set_shape({{3, 3}}, 3);
  ASSERT(null_ref.empty());

  int x;
  array_ref_of_rank<int, 0> scalar_ref(&x, {});
  ASSERT(!scalar_ref.empty());
  array_ref_of_rank<int, 0> null_scalar_ref(nullptr, {});
  ASSERT(null_scalar_ref.empty());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x820, %rsp            # imm = 0x820
leaq -0x38(%rbp), %rdi
movq %rdi, -0x7a8(%rbp)
movl $0xa, %esi
callq 0x34210
movq -0x7a8(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
leaq -0x20(%rbp), %rdi
movq %rdi, -0x7a0(%rbp)
callq 0x968a0
movq -0x7a0(%rbp), %rdi
callq 0x96fa0
movb %al, -0x791(%rbp)
leaq -0x1e9(%rbp), %rdi
movq %rdi, -0x790(%rbp)
callq 0x33b0
movq -0x790(%rbp), %rdx
leaq 0x15854b(%rip), %rsi    # 0x1e7b69
leaq -0x1e8(%rbp), %rdi
callq 0x10a90
jmp 0x8f62c
movb -0x791(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x1c8(%rbp), %rdi
leaq -0x1e8(%rbp), %rdx
callq 0x10f80
jmp 0x8f64d
leaq -0x1c8(%rbp), %rdi
callq 0x10ff0
jmp 0x8f65b
leaq -0x1e8(%rbp), %rdi
callq 0x3100
leaq -0x1e9(%rbp), %rdi
callq 0x3290
leaq -0x230(%rbp), %rdi
movq %rdi, -0x7d8(%rbp)
movl $0x3, %edx
movq %rdx, -0x7c8(%rbp)
movl $0x1, %ecx
movq %rdx, %rsi
callq 0x16d70
movq -0x7d8(%rbp), %rsi
leaq -0x218(%rbp), %rdi
movq %rdi, -0x7d0(%rbp)
callq 0x970b0
movq -0x7d0(%rbp), %rsi
movq -0x7c8(%rbp), %rdx
leaq -0x20(%rbp), %rdi
movq %rdi, -0x7c0(%rbp)
callq 0x96ff0
movq -0x7c0(%rbp), %rdi
callq 0x96fa0
movb %al, -0x7b1(%rbp)
leaq -0x3e1(%rbp), %rdi
movq %rdi, -0x7b0(%rbp)
callq 0x33b0
movq -0x7b0(%rbp), %rdx
leaq 0x158464(%rip), %rsi    # 0x1e7b69
leaq -0x3e0(%rbp), %rdi
callq 0x10a90
jmp 0x8f713
movb -0x7b1(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x3c0(%rbp), %rdi
leaq -0x3e0(%rbp), %rdx
callq 0x10f80
jmp 0x8f734
leaq -0x3c0(%rbp), %rdi
callq 0x10ff0
jmp 0x8f742
leaq -0x3e0(%rbp), %rdi
callq 0x3100
leaq -0x3e1(%rbp), %rdi
callq 0x3290
leaq -0x3f9(%rbp), %rdi
movq %rdi, -0x7f8(%rbp)
callq 0x1d390
movq -0x7f8(%rbp), %rdx
leaq -0x3f8(%rbp), %rdi
movq %rdi, -0x7f0(%rbp)
leaq -0x3e8(%rbp), %rsi
callq 0x96e00
movq -0x7f0(%rbp), %rdi
callq 0x97110
xorb $0x1, %al
movb %al, -0x7e1(%rbp)
leaq -0x5b1(%rbp), %rdi
movq %rdi, -0x7e0(%rbp)
callq 0x33b0
movq -0x7e0(%rbp), %rdx
leaq 0x1583b7(%rip), %rsi    # 0x1e7b7a
leaq -0x5b0(%rbp), %rdi
callq 0x10a90
jmp 0x8f7d1
movb -0x7e1(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x590(%rbp), %rdi
leaq -0x5b0(%rbp), %rdx
callq 0x10f80
jmp 0x8f7f2
leaq -0x590(%rbp), %rdi
callq 0x10ff0
jmp 0x8f800
leaq -0x5b0(%rbp), %rdi
callq 0x3100
leaq -0x5b1(%rbp), %rdi
callq 0x3290
leaq -0x5c9(%rbp), %rdi
movq %rdi, -0x818(%rbp)
callq 0x1d390
movq -0x818(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
leaq -0x5c8(%rbp), %rdi
movq %rdi, -0x810(%rbp)
callq 0x96e00
movq -0x810(%rbp), %rdi
callq 0x97110
movb %al, -0x801(%rbp)
leaq -0x781(%rbp), %rdi
movq %rdi, -0x800(%rbp)
callq 0x33b0
movq -0x800(%rbp), %rdx
leaq 0x158312(%rip), %rsi    # 0x1e7b8e
leaq -0x780(%rbp), %rdi
callq 0x10a90
jmp 0x8f88a
movb -0x801(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x760(%rbp), %rdi
leaq -0x780(%rbp), %rdx
callq 0x10f80
jmp 0x8f8ab
leaq -0x760(%rbp), %rdi
callq 0x10ff0
jmp 0x8f8b9
leaq -0x780(%rbp), %rdi
callq 0x3100
leaq -0x781(%rbp), %rdi
callq 0x3290
addq $0x820, %rsp            # imm = 0x820
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f8(%rbp)
movl %eax, -0x1fc(%rbp)
jmp 0x8f90c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f8(%rbp)
movl %eax, -0x1fc(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x3100
leaq -0x1e9(%rbp), %rdi
callq 0x3290
jmp 0x8f9db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f8(%rbp)
movl %eax, -0x1fc(%rbp)
jmp 0x8f94f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f8(%rbp)
movl %eax, -0x1fc(%rbp)
leaq -0x3e0(%rbp), %rdi
callq 0x3100
leaq -0x3e1(%rbp), %rdi
callq 0x3290
jmp 0x8f9db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f8(%rbp)
movl %eax, -0x1fc(%rbp)
jmp 0x8f98f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f8(%rbp)
movl %eax, -0x1fc(%rbp)
leaq -0x5b0(%rbp), %rdi
callq 0x3100
leaq -0x5b1(%rbp), %rdi
callq 0x3290
jmp 0x8f9db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f8(%rbp)
movl %eax, -0x1fc(%rbp)
jmp 0x8f9cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1f8(%rbp)
movl %eax, -0x1fc(%rbp)
leaq -0x780(%rbp), %rdi
callq 0x3100
leaq -0x781(%rbp), %rdi
callq 0x3290
movq -0x1f8(%rbp), %rdi
callq 0x33a0
nopw (%rax,%rax)