Skip to content

Commit

Permalink
testsuite: attr: Use esp for current stack point on x86 32bit
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Paulo de Souza <[email protected]>
  • Loading branch information
marcosps committed Jul 4, 2024
1 parent 0b3e33c commit a290044
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions testsuite/small/attr-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/* { dg-skip-on-archs "s390x" }*/
#ifdef __x86_64__
register unsigned long current_stack_pointer asm("rsp");
#elif __i386__
register unsigned long current_stack_pointer asm("esp");
#elif __aarch64__
register unsigned long current_stack_pointer asm("sp");
#elif __PPC64__
Expand Down
4 changes: 3 additions & 1 deletion testsuite/small/attr-6.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/* { dg-skip-on-archs "s390x" }*/
#ifdef __x86_64__
#define REG "rsp"
#elif __i386__
#define REG "esp"
#elif __aarch64__
#define REG "sp"
#elif __PPC64__
Expand All @@ -15,6 +17,6 @@ unsigned long f()
return current_stack_pointer;
}

/* { dg-final { scan-tree-dump "#define REG \"(rsp|sp|r1)\"" } } */
/* { dg-final { scan-tree-dump "#define REG \"(rsp|esp|sp|r1)\"" } } */
/* { dg-final { scan-tree-dump "current_stack_pointer asm\(REG\)" } } */
/* { dg-final { scan-tree-dump "unsigned long f" } } */

0 comments on commit a290044

Please sign in to comment.