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
6cat << "END" | $@ -x c - -fno-PIE -march=z10 -mindirect-branch=thunk-extern -mfunction-return=thunk-extern -mindirect-branch-table -O2 -c -o /dev/null
7int a;
8int b (void);
9void c (int);
10
11static void
12put_page (void)
13{
14  if (b ())
15    c (a);
16}
17
18__attribute__ ((__section__ (".init.text"), __cold__)) void
19d (void)
20{
21  put_page ();
22  put_page ();
23}
24END
25