1 /* Copyright (c) 2010-2022. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
10 static int iterate = 10;
11 static int growsdown(int *x)
18 /* The stack sometimes changes at the 0th level.
19 * Original version did fail in this case, but I changed this around SimGrid 3.13 because of https://bugs.debian.org/814272
20 * Every arch failed on that day :(
22 if (iterate != 0 && y != (x > &y)) {
23 fprintf(stderr, "The stack changed its direction! (Iteration: %d. It was growing %s; &y=%p; &prevY=%p)\n",
24 (10 - iterate), y ? "down" : "up", &y, x);
30 int main(int argc, char *argv[])
33 printf("%s", growsdown(&x) ? "down" : "up");