Emese Revfy | 6b90bd4 | 2016-05-24 00:09:38 +0200 | [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 |
Masahiro Yamada | 77342a0 | 2020-03-29 20:08:32 +0900 | [diff] [blame] | 3 | |
| 4 | set -e |
| 5 | |
Emese Revfy | 6b90bd4 | 2016-05-24 00:09:38 +0200 | [diff] [blame] | 6 | srctree=$(dirname "$0") |
Kees Cook | ed58c0e | 2016-06-17 23:11:12 -0700 | [diff] [blame] | 7 | |
Masahiro Yamada | 77342a0 | 2020-03-29 20:08:32 +0900 | [diff] [blame] | 8 | gccplugins_dir=$($* -print-file-name=plugin) |
Emese Revfy | 6b90bd4 | 2016-05-24 00:09:38 +0200 | [diff] [blame] | 9 | |
| 10 | # we need a c++ compiler that supports the designated initializer GNU extension |
Masahiro Yamada | 77342a0 | 2020-03-29 20:08:32 +0900 | [diff] [blame] | 11 | $HOSTCC -c -x c++ -std=gnu++98 - -fsyntax-only -I $srctree/gcc-plugins -I $gccplugins_dir/include 2>/dev/null <<EOF |
Emese Revfy | 6b90bd4 | 2016-05-24 00:09:38 +0200 | [diff] [blame] | 12 | #include "gcc-common.h" |
| 13 | class test { |
| 14 | public: |
| 15 | int test; |
| 16 | } test = { |
| 17 | .test = 1 |
| 18 | }; |
| 19 | EOF |