xref: /openbmc/qemu/tests/docker/test-clang (revision c8908570)
1*c8908570SFam Zheng#!/bin/bash -e
2*c8908570SFam Zheng#
3*c8908570SFam Zheng# Compile and check with clang.
4*c8908570SFam Zheng#
5*c8908570SFam Zheng# Copyright (c) 2016 Red Hat Inc.
6*c8908570SFam Zheng#
7*c8908570SFam Zheng# Authors:
8*c8908570SFam Zheng#  Fam Zheng <famz@redhat.com>
9*c8908570SFam Zheng#
10*c8908570SFam Zheng# This work is licensed under the terms of the GNU GPL, version 2
11*c8908570SFam Zheng# or (at your option) any later version. See the COPYING file in
12*c8908570SFam Zheng# the top-level directory.
13*c8908570SFam Zheng
14*c8908570SFam Zheng. common.rc
15*c8908570SFam Zheng
16*c8908570SFam Zhengrequires clang
17*c8908570SFam Zheng
18*c8908570SFam ZhengOPTS="--enable-debug --cxx=clang++ --cc=clang --host-cc=clang"
19*c8908570SFam Zheng# -fsanitize=undefined is broken on Fedora 23, skip it for now
20*c8908570SFam Zheng# See also: https://bugzilla.redhat.com/show_bug.cgi?id=1263834
21*c8908570SFam Zheng#OPTS="$OPTS --extra-cflags=-fsanitize=undefined \
22*c8908570SFam Zheng    #--extra-cflags=-fno-sanitize=float-divide-by-zero"
23*c8908570SFam ZhengDEF_TARGET_LIST="$(echo {x86_64,aarch64}-softmmu)"
24*c8908570SFam ZhengTARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \
25*c8908570SFam Zhengbuild_qemu $OPTS
26*c8908570SFam Zhengmake $MAKEFLAGS check
27