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