Skip to content

Validating LLVM with random programs

Jeff Bush edited this page Apr 8, 2017 · 17 revisions
  1. Add build directory to path

     export PATH=.../NyuziToolchain/build/bin:$PATH
    
  2. Generate random stream

     llvm-stress -size 1000 -o stress.ll
    
  3. Run test

     llc -o - stress.ll
    

If this fails, isolate the failure using instructions in Debugging Backend Crashes with bugpoint

The following script will run this in a loop:

#!/bin/bash

while :
do
  SEED=$((65536*$RANDOM+$RANDOM))
  FNAME=stress$SEED.ll
  echo "Test $FNAME"
  llvm-stress -seed=$SEED -o $FNAME -size=1000
  llc $FNAME
  if [ $? -eq 0 ]; then
    echo "PASS"
  else
      echo "FAIL!"
      echo $FNAME >> failure-list.txt
  fi  
done