bf5438fca2950 (Jason Baron 2010-09-17 11:09:00 -0400 1) #!/bin/sh
b24413180f560 (Greg Kroah-Hartman 2017-11-01 15:07:57 +0100 2) # SPDX-License-Identifier: GPL-2.0
df0a92c20652d (Jonathan Neuschäfer 2011-06-16 00:17:46 +0200 3) # Test for gcc 'asm goto' support
bf5438fca2950 (Jason Baron 2010-09-17 11:09:00 -0400 4) # Copyright (C) 2010, Jason Baron <jbaron@redhat.com>
bf5438fca2950 (Jason Baron 2010-09-17 11:09:00 -0400 5)
e9666d10a5677 (Masahiro Yamada 2018-12-31 00:14:15 +0900 6) cat << "END" | $@ -x c - -fno-PIE -c -o /dev/null
a9468f30b5eac (Rabin Vincent 2012-02-24 17:06:20 +0100 7) int main(void)
a9468f30b5eac (Rabin Vincent 2012-02-24 17:06:20 +0100 8) {
f3c003f72dfb2 (Jiang Liu 2014-01-07 22:17:12 +0800 9) #if defined(__arm__) || defined(__aarch64__)
a9468f30b5eac (Rabin Vincent 2012-02-24 17:06:20 +0100 10) /*
a9468f30b5eac (Rabin Vincent 2012-02-24 17:06:20 +0100 11) * Not related to asm goto, but used by jump label
a9468f30b5eac (Rabin Vincent 2012-02-24 17:06:20 +0100 12) * and broken on some ARM GCC versions (see GCC Bug 48637).
a9468f30b5eac (Rabin Vincent 2012-02-24 17:06:20 +0100 13) */
a9468f30b5eac (Rabin Vincent 2012-02-24 17:06:20 +0100 14) static struct { int dummy; int state; } tp;
a9468f30b5eac (Rabin Vincent 2012-02-24 17:06:20 +0100 15) asm (".long %c0" :: "i" (&tp.state));
a9468f30b5eac (Rabin Vincent 2012-02-24 17:06:20 +0100 16) #endif
a9468f30b5eac (Rabin Vincent 2012-02-24 17:06:20 +0100 17)
a9468f30b5eac (Rabin Vincent 2012-02-24 17:06:20 +0100 18) entry:
a9468f30b5eac (Rabin Vincent 2012-02-24 17:06:20 +0100 19) asm goto ("" :::: entry);
a9468f30b5eac (Rabin Vincent 2012-02-24 17:06:20 +0100 20) return 0;
a9468f30b5eac (Rabin Vincent 2012-02-24 17:06:20 +0100 21) }
a9468f30b5eac (Rabin Vincent 2012-02-24 17:06:20 +0100 22) END