summaryrefslogtreecommitdiff
path: root/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test
blob: 15f3c41d5a2462716f4cbc02aee013afbedc6837 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
#
# This file was generated by create_test_cases.py.
#
# If one branch of an if ends in a jump, and control cannot
# fall out the bottom of the other branch, and pull_out_jumps is
# True, then the jump is lifted outside the if.
# Verify that this lowering occurs during the same pass as the
# lowering of other jumps by checking that extra temporary
# variables aren't generated.
../../glsl_test optpass --quiet --input-ir 'do_lower_jumps(1, 0, 1, 0, 0)' <<EOF
((declare (in) float aa) (declare (in) float ab) (declare (in) float b)
 (declare (in) float c)
 (declare (out) float d)
 (function main
  (signature void (parameters)
   ((if (expression bool > (var_ref aa) (constant float (0.000000)))
     ((if (expression bool > (var_ref ab) (constant float (0.000000)))
       ((return))
       ()))
     ())
    (loop () () () ()
     ((if (expression bool > (var_ref b) (constant float (0.000000)))
       ((if (expression bool > (var_ref c) (constant float (0.000000))) (break)
         (continue)))
       ((return)))))
    (assign (x) (var_ref d) (constant float (1.000000)))))))
EOF