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