Commit 4c70054975bd5b85cd3089f88e55fa0f77c099cc

Authored by Austin Sun
1 parent c30bbd12c1
Exists in master

test cases

Showing 30 changed files with 144 additions and 0 deletions Side-by-side Diff

Checkpoint/arith_gt_float.dat View file @ 4c70054
  1 +funct: arith
  2 +gin: x, float, 19
  3 +gin: y, float, 2.5
Checkpoint/arith_gt_float.glsl View file @ 4c70054
  1 +float x;
  2 +float y;
  3 +
  4 +bool arith()
  5 +{
  6 + return x > y;
  7 +}
Checkpoint/arith_gt_float.out View file @ 4c70054
  1 +Result: -1
Checkpoint/arith_post_dec_int.dat View file @ 4c70054
  1 +funct: arith
  2 +gin: x, int, 10
  3 +gin: y, int, 3
Checkpoint/arith_post_dec_int.glsl View file @ 4c70054
  1 +int x;
  2 +int y;
  3 +
  4 +int arith()
  5 +{
  6 + x--;
  7 + return x--;
  8 +}
Checkpoint/arith_post_dec_int.out View file @ 4c70054
  1 +Result: 9
Checkpoint/arith_pre_inc_int.dat View file @ 4c70054
  1 +funct: arith
  2 +gin: x, int, 10
  3 +gin: y, int, 3
Checkpoint/arith_pre_inc_int.glsl View file @ 4c70054
  1 +int x;
  2 +int y;
  3 +
  4 +int arith()
  5 +{
  6 + ++x;
  7 + return ++x;
  8 +}
Checkpoint/arith_pre_inc_int.out View file @ 4c70054
  1 +Result: 12
Checkpoint/for_loop.dat View file @ 4c70054
  1 +funct: fortest
  2 +gin: a, int, 10
  3 +gin: v, float, 1.0
Checkpoint/for_loop.glsl View file @ 4c70054
  1 +float v;
  2 +int a;
  3 +
  4 +float fortest()
  5 +{
  6 + int i;
  7 + float sum;
  8 +
  9 + sum = v;
  10 + for ( i = 0; i < a; i += 1 )
  11 + sum *= 2.0;
  12 +
  13 + return sum;
  14 +}
Checkpoint/for_loop.out View file @ 4c70054
  1 +Result: 1.024000e+03
Checkpoint/func_ret_bool.dat View file @ 4c70054
  1 +funct: foo
Checkpoint/func_ret_bool.glsl View file @ 4c70054
  1 +bool foo()
  2 +{
  3 + return true;
  4 +}
Checkpoint/func_ret_bool.out View file @ 4c70054
  1 +Result: -1
Checkpoint/if_test.dat View file @ 4c70054
  1 +funct: iftest
  2 +gin: a, float, 0.5
Checkpoint/if_test.glsl View file @ 4c70054
  1 +float a;
  2 +
  3 +float iftest()
  4 +{
  5 + float f;
  6 + if ( a > 1.0 ) {
  7 + f = 2.0;
  8 + } else {
  9 + f = 1.0;
  10 + }
  11 + return f;
  12 +}
Checkpoint/if_test.out View file @ 4c70054
  1 +Result: 1.000000e+00
Checkpoint/multi_ret.dat View file @ 4c70054
  1 +funct: multiret
  2 +param: int, 2
Checkpoint/multi_ret.glsl View file @ 4c70054
  1 +
  2 +int multiret(int a)
  3 +{
  4 + if ( a > 1 )
  5 + return 1;
  6 + else
  7 + return 0;
  8 +}
  9 +
  10 +int multiret2(int a)
  11 +{
  12 + int b;
  13 +
  14 + if ( a > 1 )
  15 + b = 1;
  16 + else
  17 + return 0;
  18 +
  19 + return b;
  20 +}
Checkpoint/multi_ret.out View file @ 4c70054
  1 +Result: 1
Checkpoint/switch_basic.dat View file @ 4c70054
  1 +funct: switchtest
  2 +gin: a, int, 2
Checkpoint/switch_basic.glsl View file @ 4c70054
  1 +int a;
  2 +float switchtest()
  3 +{
  4 + float f;
  5 +
  6 + switch( a ) {
  7 + case 0: f = 0.0; break;
  8 + case 1: f = 1.0; break;
  9 + case 2: f = 2.0; break;
  10 + default: f = 3.0; break;
  11 + }
  12 +
  13 + return f;
  14 +}
Checkpoint/switch_basic.out View file @ 4c70054
  1 +Result: 2.000000e+00
Checkpoint/vect_assign.dat View file @ 4c70054
  1 +funct: vectassign
  2 +gin: v, vec2, 0.5, 1.5
Checkpoint/vect_assign.glsl View file @ 4c70054
  1 +vec2 v;
  2 +
  3 +float vectassign()
  4 +{
  5 + vec2 t;
  6 + t = v;
  7 + return t.x * t.y;
  8 +}
Checkpoint/vect_assign.out View file @ 4c70054
  1 +Result: 7.500000e-01
Checkpoint/while_loop.dat View file @ 4c70054
  1 +funct: whiletest
  2 +gin: b, int, 101
Checkpoint/while_loop.glsl View file @ 4c70054
  1 +int b;
  2 +int whiletest()
  3 +{
  4 +
  5 + int i;
  6 + int sum;
  7 +
  8 + i = 0;
  9 + sum = 0;
  10 + while ( i < b ) {
  11 + sum = sum + i;
  12 + i = i + 1;
  13 + }
  14 + return sum;
  15 +}
Checkpoint/while_loop.out View file @ 4c70054
  1 +Result: 5050