gcc-thunk-extern.sh 553 B

123456789101112131415161718192021222324
  1. #!/bin/sh
  2. # SPDX-License-Identifier: GPL-2.0
  3. # Borrowed from gcc: gcc/testsuite/gcc.target/s390/nobp-section-type-conflict.c
  4. # Checks that we don't get error: section type conflict with ‘put_page’.
  5. cat << "END" | $@ -x c - -fno-PIE -march=z10 -mindirect-branch=thunk-extern -mfunction-return=thunk-extern -mindirect-branch-table -O2 -c -o /dev/null
  6. int a;
  7. int b (void);
  8. void c (int);
  9. static void
  10. put_page (void)
  11. {
  12. if (b ())
  13. c (a);
  14. }
  15. __attribute__ ((__section__ (".init.text"), __cold__)) void
  16. d (void)
  17. {
  18. put_page ();
  19. put_page ();
  20. }
  21. END