Home | History | Annotate | Download | only in lower_jumps
      1 #!/bin/bash
      2 #
      3 # This file was generated by create_test_cases.py.
      4 #
      5 # If both branches of an if statement end in a return, and
      6 # pull_out_jumps is True, then those returns should be lifted
      7 # outside the if and then properly lowered.
      8 # Verify that this lowering occurs during the same pass as the
      9 # lowering of other returns by checking that extra temporary
     10 # variables aren't generated.
     11 ../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(1, 0, 1, 0, 0)' <<EOF
     12 ((declare (in) float aa) (declare (in) float ab) (declare (in) float b)
     13  (declare (in) float c)
     14  (function main
     15   (signature void (parameters)
     16    ((if (expression bool > (var_ref aa) (constant float (0.000000)))
     17      ((if (expression bool > (var_ref ab) (constant float (0.000000)))
     18        ((return))
     19        ()))
     20      ())
     21     (if (expression bool > (var_ref b) (constant float (0.000000)))
     22      ((if (expression bool > (var_ref c) (constant float (0.000000)))
     23        ((return))
     24        ((return))))
     25      ())))))
     26 EOF
     27