Add a test to ensure that the restrictions of barrier() go away if
replaced

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
split barrier-switch case