// File: /workspace/github_cpp_makefile_star2_O2/dsharlet[P]array/test/array.cpp
// Function: nda::test_array_negative_strides_body()
TEST(array_negative_strides) {
  // Test with a negative stride in y.
  array_of_rank<int, 2> a({{0, 10, 3}, {0, 3, -1}});
  fill_pattern(a);

  // Test with a negative stride in x.
  array_of_rank<int, 2> b({{0, 20, -1}, {0, 10}});
  ASSERT_EQ(b.y().stride(), 20);
  fill_pattern(b);

  // Check that making a copy with positive strides preserves
  // the contents of the array.
  dense_array<int, 2> a_compact = make_compact_copy(a);
  ASSERT_LT(0, a_compact.y().stride());
  check_pattern(a_compact);

  dense_array<int, 2> b_compact = make_compact_copy(b);
  ASSERT_EQ(b_compact.x().stride(), 1);
  check_pattern(b_compact);
}

// Assembly:
pushq %rbx
subq $0x300, %rsp            # imm = 0x300
leaq 0x170(%rsp), %rsi
andq $0x0, (%rsi)
pushq $0x3
popq %rax
movq %rax, 0x8(%rsi)
orq $-0x1, 0x10(%rsi)
andq $0x0, 0x18(%rsi)
movq $0xa, 0x20(%rsi)
movq %rax, 0x28(%rsi)
leaq 0x120(%rsp), %rbx
movq %rbx, %rdi
callq 0x69d2
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11846
leaq 0x170(%rsp), %rsi
andq $0x0, (%rsi)
movq $0xa, 0x8(%rsi)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, 0x10(%rsi)
andq $0x0, 0x18(%rsi)
movq $0x14, 0x20(%rsi)
orq $-0x1, 0x28(%rsi)
leaq 0xd0(%rsp), %rdi
callq 0x69d2
movq 0x100(%rsp), %rbx
leaq 0x7fa25(%rip), %rsi     # 0x8f532
leaq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
cmpq $0x14, %rbx
sete %sil
leaq 0x170(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x6894
leaq 0x7db08(%rip), %rsi     # 0x8d647
leaq 0x170(%rsp), %rdi
callq 0x106fe
leaq 0x7f9f4(%rip), %rsi     # 0x8f547
movq %rax, %rdi
callq 0x11bb4
leaq 0x81a90(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0x100(%rsp), %rcx
leaq 0x80(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x7dabb(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x7f9a9(%rip), %rsi     # 0x8f544
movq %rax, %rdi
callq 0x10896
leaq 0x81a48(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x10(%rsp), %rsi
movl $0x14, (%rsi)
movq %rax, %rdi
callq 0x10736
leaq 0x956d6(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0x170(%rsp), %rdi
callq 0x68d4
leaq 0x30(%rsp), %rdi
callq 0x2090
leaq 0xd0(%rsp), %rdi
xorl %esi, %esi
callq 0x11846
leaq 0x30(%rsp), %rdi
leaq 0x120(%rsp), %rsi
leaq 0x170(%rsp), %rdx
callq 0x11bcf
movq 0x60(%rsp), %rbx
leaq 0x7f936(%rip), %rsi     # 0x8f556
leaq 0x80(%rsp), %rdi
leaq 0x4(%rsp), %rdx
callq 0x66a0
xorl %esi, %esi
testq %rbx, %rbx
setg %sil
leaq 0x170(%rsp), %rdi
leaq 0x80(%rsp), %rdx
callq 0x6894
leaq 0x7d9f0(%rip), %rsi     # 0x8d647
leaq 0x170(%rsp), %rdi
callq 0x106fe
leaq 0x7f585(%rip), %rsi     # 0x8f1f0
movq %rax, %rdi
callq 0x106fe
leaq 0x81978(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x8(%rsp), %rsi
andl $0x0, (%rsi)
movq %rax, %rdi
callq 0x10736
leaq 0x7d9ae(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x7f8b2(%rip), %rsi     # 0x8f55a
movq %rax, %rdi
callq 0x11256
leaq 0x8193b(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
movq 0x60(%rsp), %rcx
leaq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x955c7(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0x170(%rsp), %rdi
callq 0x68d4
leaq 0x80(%rsp), %rdi
callq 0x2090
xorps %xmm0, %xmm0
leaq 0x170(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0x30(%rsp), %rdi
callq 0x11c0c
leaq 0x80(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
leaq 0x170(%rsp), %rdx
callq 0x11bcf
leaq 0x7f838(%rip), %rsi     # 0x8f571
leaq 0x10(%rsp), %rdi
leaq 0x3(%rsp), %rdx
callq 0x66a0
leaq 0x170(%rsp), %rdi
pushq $0x1
popq %rsi
leaq 0x10(%rsp), %rdx
callq 0x6894
leaq 0x7d8e3(%rip), %rsi     # 0x8d647
leaq 0x170(%rsp), %rdi
callq 0x106fe
leaq 0x7f815(%rip), %rsi     # 0x8f58d
movq %rax, %rdi
callq 0x11256
leaq 0x8186b(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x8(%rsp), %rsi
movq $0x1, (%rsi)
movq %rax, %rdi
callq 0x107ba
leaq 0x7d89d(%rip), %rsi     # 0x8d647
movq %rax, %rdi
callq 0x106fe
leaq 0x84f43(%rip), %rsi     # 0x94cfc
movq %rax, %rdi
callq 0x106fe
leaq 0x8182a(%rip), %rsi     # 0x915f2
movq %rax, %rdi
callq 0x106fe
leaq 0x4(%rsp), %rsi
movl $0x1, (%rsi)
movq %rax, %rdi
callq 0x10736
leaq 0x954b8(%rip), %rsi     # 0xa52a2
movq %rax, %rdi
callq 0x106fe
leaq 0x170(%rsp), %rdi
callq 0x68d4
leaq 0x10(%rsp), %rdi
callq 0x2090
xorps %xmm0, %xmm0
leaq 0x170(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0x80(%rsp), %rdi
callq 0x11c0c
leaq 0x80(%rsp), %rdi
callq 0x108fe
leaq 0x30(%rsp), %rdi
callq 0x108fe
leaq 0xd0(%rsp), %rdi
callq 0x6aca
leaq 0x120(%rsp), %rdi
callq 0x6aca
addq $0x300, %rsp            # imm = 0x300
popq %rbx
retq
jmp 0xfe60
movq %rax, %rbx
jmp 0xfeb9
jmp 0xfe69
jmp 0xfe69
movq %rax, %rbx
jmp 0xfee5
jmp 0xfe72
jmp 0xfe72
movq %rax, %rbx
jmp 0xff0b
jmp 0xfe7c
movq %rax, %rbx
jmp 0xff18
jmp 0xfe9f
movq %rax, %rbx
jmp 0xfeaf
jmp 0xfec8
movq %rax, %rbx
jmp 0xfed8
jmp 0xfef1
movq %rax, %rbx
jmp 0xff01
jmp 0xfe9f
jmp 0xfec8
jmp 0xfef1
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
callq 0x68d4
leaq 0x10(%rsp), %rdi
callq 0x2090
leaq 0x80(%rsp), %rdi
callq 0x108fe
jmp 0xfee5
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
callq 0x68d4
leaq 0x80(%rsp), %rdi
callq 0x2090
leaq 0x30(%rsp), %rdi
callq 0x108fe
jmp 0xff0b
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
callq 0x68d4
leaq 0x30(%rsp), %rdi
callq 0x2090
leaq 0xd0(%rsp), %rdi
callq 0x6aca
leaq 0x120(%rsp), %rdi
callq 0x6aca
movq %rbx, %rdi
callq 0x22f0
movq %rax, %rdi
callq 0x6bba