2 * Copyright 2010 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
8 * This test checks to see if using negative indexes cause problems.
9 * (Regression test for an X86-64 sandboxing bug)
12 #include "barebones.h"
15 volatile unsigned arr[110];
17 void checkarray(void);
19 int main(int argc, char* argv[]) {
22 return 0; /* unreachable */
27 for (i = s; i > 0; i--) {
28 arr[s - i] = (i%2 ? 1 : 0);
32 void checkarray(void) {
36 for (i = 0; i > -s; i--) {
37 sum += arr[s + i - 1];
39 NACL_SYSCALL(exit)(sum);