// File: dsharlet[P]array/test/shape.cpp
// Function: nda::test_dim_set_stride_body()
TEST(dim_set_stride) {
  dim<> x(3, 10, 4);
  x.set_stride(5);
  ASSERT_EQ(x.stride(), 5);

  dim<dynamic, dynamic, 4> y(100, 120);
  // set_stride(unresolved) is a valid noop on a static stride.
  y.set_stride(unresolved);
  ASSERT_EQ(y.stride(), 4);

  // Uncommenting this will cause an assertion failure.
  // y.set_stride(5);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4f0, %rsp            # imm = 0x4F0
leaq -0x80(%rbp), %rdi
movq %rdi, -0x450(%rbp)
movl $0x3, %esi
movl $0xa, %edx
movl $0x4, %ecx
callq 0x10c60
movq -0x450(%rbp), %rax
movq %rax, -0x50(%rbp)
movq $0x5, -0x58(%rbp)
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
addq $0x10, %rdi
callq 0x12bf0
movq -0x450(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
subq $0x5, %rax
sete %al
movb %al, -0x441(%rbp)
leaq -0x231(%rbp), %rdi
movq %rdi, -0x440(%rbp)
callq 0x33b0
movq -0x440(%rbp), %rdx
leaq 0x78a1b(%rip), %rsi     # 0x1fbb45
leaq -0x230(%rbp), %rdi
callq 0x10a90
jmp 0x183138
movb -0x441(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x210(%rbp), %rdi
leaq -0x230(%rbp), %rdx
callq 0x10f80
jmp 0x183159
leaq 0x59685(%rip), %rsi     # 0x1dc7e5
leaq -0x210(%rbp), %rdi
callq 0x34320
movq %rax, -0x458(%rbp)
jmp 0x183175
movq -0x458(%rbp), %rdi
leaq 0x789d2(%rip), %rsi     # 0x1fbb55
callq 0x34570
movq %rax, -0x460(%rbp)
jmp 0x183191
movq -0x460(%rbp), %rdi
leaq 0x5d60d(%rip), %rsi     # 0x1e07ac
callq 0x34320
movq %rax, -0x468(%rbp)
jmp 0x1831ad
leaq -0x80(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x470(%rbp)
movq -0x468(%rbp), %rdi
movq -0x470(%rbp), %rax
movq %rax, -0x250(%rbp)
leaq -0x250(%rbp), %rsi
callq 0x34510
movq %rax, -0x478(%rbp)
jmp 0x1831f9
movq -0x478(%rbp), %rdi
leaq 0x595de(%rip), %rsi     # 0x1dc7e5
callq 0x34320
movq %rax, -0x480(%rbp)
jmp 0x183215
movq -0x480(%rbp), %rdi
leaq 0x5b53a(%rip), %rsi     # 0x1de75d
callq 0x34320
movq %rax, -0x488(%rbp)
jmp 0x183231
movq -0x488(%rbp), %rdi
leaq 0x5d56d(%rip), %rsi     # 0x1e07ac
callq 0x34320
movq %rax, -0x490(%rbp)
jmp 0x18324d
movq -0x490(%rbp), %rdi
movl $0x5, -0x254(%rbp)
leaq -0x254(%rbp), %rsi
callq 0x343a0
movq %rax, -0x498(%rbp)
jmp 0x183273
movq -0x498(%rbp), %rdi
leaq 0x731fa(%rip), %rsi     # 0x1f647b
callq 0x34320
jmp 0x183288
leaq -0x210(%rbp), %rdi
callq 0x10ff0
jmp 0x183296
leaq -0x230(%rbp), %rdi
callq 0x3100
leaq -0x231(%rbp), %rdi
callq 0x3290
leaq -0x270(%rbp), %rdi
movl $0x64, %esi
movl $0x78, %edx
movl $0x4, %ecx
callq 0x12ae50
leaq -0x270(%rbp), %rax
movq %rax, -0x40(%rbp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x18(%rbp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
cmpq %rax, -0x18(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, %ecx
movb $0x1, %al
cmpq $0x0, %rcx
movb %al, -0x499(%rbp)
jne 0x18331e
cmpq $0x4, -0x48(%rbp)
sete %al
movb %al, -0x499(%rbp)
movb -0x499(%rbp), %al
testb $0x1, %al
jne 0x183347
leaq 0x58e8a(%rip), %rdi     # 0x1dc1b9
leaq 0x58dab(%rip), %rsi     # 0x1dc0e1
movl $0x1da, %edx            # imm = 0x1DA
leaq 0x6efea(%rip), %rcx     # 0x1f232c
callq 0x3130
leaq -0x270(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x10(%rbp)
movb $0x1, %al
movb %al, -0x4a9(%rbp)
leaq -0x421(%rbp), %rdi
movq %rdi, -0x4a8(%rbp)
callq 0x33b0
movq -0x4a8(%rbp), %rdx
leaq 0x787d9(%rip), %rsi     # 0x1fbb60
leaq -0x420(%rbp), %rdi
callq 0x10a90
jmp 0x183395
movb -0x4a9(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x400(%rbp), %rdi
leaq -0x420(%rbp), %rdx
callq 0x10f80
jmp 0x1833b6
leaq 0x59428(%rip), %rsi     # 0x1dc7e5
leaq -0x400(%rbp), %rdi
callq 0x34320
movq %rax, -0x4b8(%rbp)
jmp 0x1833d2
movq -0x4b8(%rbp), %rdi
leaq 0x78790(%rip), %rsi     # 0x1fbb70
callq 0x34570
movq %rax, -0x4c0(%rbp)
jmp 0x1833ee
movq -0x4c0(%rbp), %rdi
leaq 0x5d3b0(%rip), %rsi     # 0x1e07ac
callq 0x34320
movq %rax, -0x4c8(%rbp)
jmp 0x18340a
leaq -0x270(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x8(%rbp)
movq -0x4c8(%rbp), %rdi
movq $0x4, -0x430(%rbp)
leaq -0x430(%rbp), %rsi
callq 0x34510
movq %rax, -0x4d0(%rbp)
jmp 0x183448
movq -0x4d0(%rbp), %rdi
leaq 0x5938f(%rip), %rsi     # 0x1dc7e5
callq 0x34320
movq %rax, -0x4d8(%rbp)
jmp 0x183464
movq -0x4d8(%rbp), %rdi
leaq 0x5e273(%rip), %rsi     # 0x1e16e5
callq 0x34320
movq %rax, -0x4e0(%rbp)
jmp 0x183480
movq -0x4e0(%rbp), %rdi
leaq 0x5d31e(%rip), %rsi     # 0x1e07ac
callq 0x34320
movq %rax, -0x4e8(%rbp)
jmp 0x18349c
movq -0x4e8(%rbp), %rdi
movl $0x4, -0x434(%rbp)
leaq -0x434(%rbp), %rsi
callq 0x343a0
movq %rax, -0x4f0(%rbp)
jmp 0x1834c2
movq -0x4f0(%rbp), %rdi
leaq 0x72fab(%rip), %rsi     # 0x1f647b
callq 0x34320
jmp 0x1834d7
leaq -0x400(%rbp), %rdi
callq 0x10ff0
jmp 0x1834e5
leaq -0x420(%rbp), %rdi
callq 0x3100
leaq -0x421(%rbp), %rdi
callq 0x3290
addq $0x4f0, %rsp            # imm = 0x4F0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x18355c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x183550
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x10ff0
jmp 0x18354e
jmp 0x183550
leaq -0x230(%rbp), %rdi
callq 0x3100
leaq -0x231(%rbp), %rdi
callq 0x3290
jmp 0x1835cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x1835c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
jmp 0x1835b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x240(%rbp)
movl %eax, -0x244(%rbp)
leaq -0x400(%rbp), %rdi
callq 0x10ff0
jmp 0x1835b2
jmp 0x1835b4
leaq -0x420(%rbp), %rdi
callq 0x3100
leaq -0x421(%rbp), %rdi
callq 0x3290
movq -0x240(%rbp), %rdi
callq 0x33a0
movq %rax, %rdi
callq 0x116d0