Path: blob/master/tools/memory-model/scripts/simpletest.sh
29266 views
#!/bin/sh1# SPDX-License-Identifier: GPL-2.0+2#3# Give zero status if this is a simple test and non-zero otherwise.4# Simple tests do not contain locking, RCU, or SRCU.5#6# Usage:7# simpletest.sh file.litmus8#9# Copyright IBM Corporation, 201910#11# Author: Paul E. McKenney <[email protected]>121314litmus=$11516if test -f "$litmus" -a -r "$litmus"17then18:19else20echo ' --- ' error: \"$litmus\" is not a readable file21exit 25522fi23exclude="^[[:space:]]*\("24exclude="${exclude}spin_lock(\|spin_unlock(\|spin_trylock(\|spin_is_locked("25exclude="${exclude}\|rcu_read_lock(\|rcu_read_unlock("26exclude="${exclude}\|synchronize_rcu(\|synchronize_rcu_expedited("27exclude="${exclude}\|srcu_read_lock(\|srcu_read_unlock("28exclude="${exclude}\|synchronize_srcu(\|synchronize_srcu_expedited("29exclude="${exclude}\)"30if grep -q $exclude $litmus31then32exit 25533fi34exit 0353637