1 group basic "Basic Tests"
14 case invalid_identifier
27 values { output float out0 = 0.0; }
29 precision mediump float;
44 case invalid_directive
55 case missing_identifier
67 values { output float out0 = -1.0; }
69 precision mediump float;
83 values { output float out0 = -1.0; }
85 precision mediump float;
92 out0 = VALUE(2.0) - 1.0;
100 values { output float out0 = 1.0; }
102 precision mediump float;
115 case identifier_with_double_underscore
116 values { output float out0 = 1.0; }
118 precision mediump float;
124 // __VALUE__ not used since it might be set by an "underlying software layer"
132 group definitions "Symbol Definition Tests"
134 case define_value_and_function
135 values { output float out0 = 6.0; }
138 precision mediump float;
139 ${DECLARATIONS:single-line}
140 # define VALUE (1.5 + 2.5)
141 # define FUNCTION(__LINE__, b) __LINE__+b
145 out0 = FUNCTION(VALUE, ((0.2) + 1.8) );
151 case undefine_object_invalid_syntax
154 precision mediump float;
161 ${POSITION_FRAG_COLOR} = vec4(VAL);
166 case undefine_invalid_object_1
169 precision mediump float;
174 ${POSITION_FRAG_COLOR} = vec4(__LINE__);
179 case undefine_invalid_object_2
182 precision mediump float;
187 ${POSITION_FRAG_COLOR} = vec4(__FILE__);
192 case undefine_invalid_object_3
195 precision mediump float;
200 ${POSITION_FRAG_COLOR} = vec4(__VERSION__);
205 case undefine_invalid_object_4
208 precision mediump float;
213 ${POSITION_FRAG_COLOR} = vec4(GL_ES);
218 case undefine_function
219 values { output float out0 = 1.0; }
221 precision mediump float;
223 #define FUNCTION(a,b) a+b
225 #define FUNCTION(a,b) a-b
229 out0 = FUNCTION(3.0, 2.0);
237 group invalid_definitions "Invalid Definition Tests"
239 case define_non_identifier
242 precision mediump float;
247 ${POSITION_FRAG_COLOR} = vec4(1.0);
252 case undef_non_identifier_1
255 precision mediump float;
260 ${POSITION_FRAG_COLOR} = vec4(1.0);
265 case undef_non_identifier_2
268 precision mediump float;
273 ${POSITION_FRAG_COLOR} = vec4(1.0);
279 end # invalid_definitions
281 group object_redefinitions "Object Redefinition Tests"
283 case invalid_object_ident
286 precision mediump float;
289 # define VALUE (AAA - 1.0)
290 # define VALUE (AAAA - 1.0)
294 ${POSITION_FRAG_COLOR} = vec4(VALUE);
299 case invalid_object_whitespace
302 precision mediump float;
304 # define VALUE (AAA - 1.0)
305 # define VALUE (AAA- 1.0)
309 ${POSITION_FRAG_COLOR} = vec4(VALUE);
314 case invalid_object_op
317 precision mediump float;
319 # define VALUE (AAA - 1.0)
320 # define VALUE (AAA + 1.0)
324 ${POSITION_FRAG_COLOR} = vec4(VALUE);
329 case invalid_object_floatval_1
332 precision mediump float;
334 # define VALUE (AAA - 1.0)
335 # define VALUE (AAA - 1.1)
339 ${POSITION_FRAG_COLOR} = vec4(VALUE);
344 case invalid_object_floatval_2
347 precision mediump float;
349 # define VALUE (AAA - 1.0)
350 # define VALUE (AAA - 1.0e-1)
354 ${POSITION_FRAG_COLOR} = vec4(VALUE);
359 case invalid_object_intval_1
362 precision mediump float;
364 # define VALUE (AAA - 1)
365 # define VALUE (AAA - 2)
369 ${POSITION_FRAG_COLOR} = vec4(VALUE);
374 case invalid_object_intval_2
377 precision mediump float;
379 # define VALUE (AAA - 1)
380 # define VALUE (AAA - 0x1)
384 ${POSITION_FRAG_COLOR} = vec4(VALUE);
389 case redefine_object_1
390 values { output float out0 = 6.0; }
393 precision mediump float;
398 #define RES2 (RES1 * VAL2)
399 #define RES1 (VAL2 / VAL1)
400 #define RES2 (RES1 * VAL2)
401 #define VALUE (RES2 + RES1)
411 case redefine_object_ifdef
412 values { output float out0 = 1.0; }
415 precision mediump float;
434 case redefine_object_undef_ifdef
435 values { output float out0 = 1.0; }
438 precision mediump float;
458 case redefine_object_ifndef
459 values { output float out0 = 1.0; }
462 precision mediump float;
481 case redefine_object_defined_1
482 values { output float out0 = 1.0; }
485 precision mediump float;
504 case redefine_object_defined_2
505 values { output float out0 = 1.0; }
508 precision mediump float;
527 case redefine_object_comment
528 values { output float out0 = 6.0; }
531 precision mediump float;
536 #define RES2 /* fdsjklfdsjkl dsfjkhfdsjkh fdsjklhfdsjkh */ (RES1 * VAL2)
537 #define RES1 (VAL2 / VAL1)
538 #define RES2 /* ewrlkjhsadf */ (RES1 * VAL2)
539 #define VALUE (RES2 + RES1)
549 case redefine_object_multiline_comment
550 values { output float out0 = 6.0; }
553 precision mediump float;
558 #define RES2 /* fdsjklfdsjkl
560 fdsjklhfdsjkh */ (RES1 * VAL2)
561 #define RES1 (VAL2 / VAL1)
562 #define RES2 /* ewrlkjhsadf */ (RES1 * VAL2)
563 #define VALUE (RES2 + RES1)
573 end # object_redefinitions
575 group invalid_redefinitions "Invalid Redefinitions Tests"
577 case invalid_identifier_2
580 precision mediump float;
581 # define GL_VALUE 1.0
585 ${POSITION_FRAG_COLOR} = vec4(GL_VALUE);
590 end # invalid_redefinitions
592 group comments "Comment Tests"
594 case multiline_comment_define
595 values { output float out0 = 4.2; }
597 precision mediump float;
599 #define VALUE /* current
611 values { output float out0 = 1.0; }
613 precision mediump float;
627 values { output float out0 = 1.0; }
629 precision mediump float;
644 values { output float out0 = 1.0; }
646 precision mediump float;
663 precision mediump float;
667 ${POSITION_FRAG_COLOR} = 1.0;
672 case unterminated_comment_1
675 precision mediump float;
683 case unterminated_comment_2
687 precision mediump float;
696 group function_definitions "Function Definitions Tests"
698 case same_object_and_function_param
699 values { output float out0 = 1.0; }
702 precision mediump float;
705 #define FUNCTION(VALUE, B) (VALUE-B)
709 out0 = FUNCTION(3.0, 2.0);
716 values { output float out0 = 518.5; }
718 precision mediump float;
720 #define AAA(a,b) a*(BBB(a,b))
725 out0 = BBB(AAA(8.0/4.0, 2.0)*BBB(2.0*2.0,0.75*2.0), AAA(40.0,10.0*BBB(5.0,3.0)));
731 case function_definition_with_comments
732 values { output float out0 = 3.0; }
734 precision mediump float;
736 /* sdfljk */ #/* sdfljk */define /* sdfljk */ FUNC( /* jklsfd*/a /*sfdjklh*/, /*sdfklj */b /*sdfklj*/) a+b
740 out0 = FUNC(1.0, 2.0);
746 end # function_definitions
748 group recursion "Recursions Tests"
753 precision mediump float;
758 ${POSITION_FRAG_COLOR} = vec4(AAA);
766 precision mediump float;
772 ${POSITION_FRAG_COLOR} = vec4(AAA);
780 precision mediump float;
781 # define AAA (1.0+BBB)
782 #define BBB (2.0+AAA)
786 ${POSITION_FRAG_COLOR} = vec4(AAA);
794 precision mediump float;
795 # define AAA(a) AAA(a)
799 ${POSITION_FRAG_COLOR} = vec4(AAA(1.0));
807 precision mediump float;
808 # define AAA(a, b) AAA(b, a)
812 ${POSITION_FRAG_COLOR} = vec4(AAA(1.0, 2.0));
819 group function_redefinitions "Function Redefinition Tests"
821 case function_redefinition_1
822 values { output float out0 = 3.0; }
824 precision mediump float;
825 # define FUNC(a,b) a+b
826 # define FUNC( a, b) a+b
831 out0 = FUNC(1.0, 2.0);
837 case function_redefinition_2
838 values { output float out0 = 3.0; }
840 precision mediump float;
841 # define FUNC(a,b) (a +b)
842 # define FUNC( a, b )(a +b)
847 out0 = FUNC(1.0, 2.0);
853 case function_redefinition_3
854 values { output float out0 = 3.0; }
856 precision mediump float;
857 # define FUNC(a,b) (a +b)
858 # define FUNC(a,b)(a /* comment
864 out0 = FUNC(1.0, 2.0);
870 case invalid_function_redefinition_param_1
873 precision mediump float;
874 # define FUNC(a,b) a+b
875 # define FUNC(A,b) A+b
879 ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0));
884 case invalid_function_redefinition_param_2
887 precision mediump float;
888 # define FUNC(a,b) a+b
889 # define FUNC(a,b,c) a+b+c
893 ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0, 3.0));
898 case invalid_function_redefinition_param_3
901 precision mediump float;
902 # define FUNC(a,b) a+b
903 # define FUNC(a,b) b+a
907 ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0));
912 end # functions_redefinitions
914 group invalid_function_definitions "Invalid Function Definition Tests"
919 precision mediump float;
920 # define FUNC(a,b) a+b
924 ${POSITION_FRAG_COLOR} = vec4(FUNC);
932 precision mediump float;
933 # define FUNC(a,b) a+b
937 ${POSITION_FRAG_COLOR} = vec4(FUNC());
945 precision mediump float;
946 # define FUNC(a,b) a+b
950 ${POSITION_FRAG_COLOR} = vec4(FUNC((();
958 precision mediump float;
959 # define FUNC(a,b) a+b
963 ${POSITION_FRAG_COLOR} = vec4(FUNC));
971 precision mediump float;
972 # define FUNC(a,b) a+b
976 ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0));
984 precision mediump float;
985 # define FUNC(a,b) a+b
989 ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0);
997 precision mediump float;
998 # define FUNC(a,b) a+b
1002 ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,));
1010 precision mediump float;
1011 # define FUNC(a,b) a+b
1015 ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0, 2.0, 3.0));
1020 case unique_param_name
1023 precision mediump float;
1024 # define FUNC(a,a) a+a
1028 ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
1033 case argument_list_1
1036 precision mediump float;
1037 # define FUNC(a b) a+b
1041 ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
1046 case argument_list_2
1049 precision mediump float;
1050 # define FUNC(a + b) a+b
1054 ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
1059 case argument_list_3
1062 precision mediump float;
1063 # define FUNC(,a,b) a+b
1067 ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
1072 case no_closing_parenthesis_1
1075 precision mediump float;
1080 ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
1085 case no_closing_parenthesis_2
1088 precision mediump float;
1093 ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
1098 case no_closing_parenthesis_3
1101 precision mediump float;
1102 # define FUNC(A,B,C a+b
1106 ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0));
1111 case no_closing_parenthesis_4
1114 precision mediump float;
1119 end # invalid_function_definitions
1121 group semantic "Semantic Tests"
1123 case ops_as_arguments
1124 values { output float out0 = 20.0; }
1126 precision mediump float;
1128 #define FOO(a, b) (1 a 9) b 2
1132 out0 = float(FOO(+, *));
1139 values { output float out0 = 1.0; }
1141 precision mediump float;
1148 out0 = FUNC(A - 1.0);
1156 group predefined_macros "Predefined Macros Tests"
1159 values { output float out0 = 100.0; }
1161 precision mediump float;
1165 #define AAA __VERSION__
1173 values { output float out0 = 1.0; }
1175 precision mediump float;
1180 out0 = float(GL_ES);
1187 values { output float out0 = 1.0; }
1189 precision mediump float;
1195 out0 = float(AAA(GL_ES));
1202 values { output float out0 = 1.0; }
1204 const mediump int line = __LINE__;
1205 precision mediump float;
1216 # Note: Arguments are macro replaced in the first stage.
1217 # Macro replacement list is expanded in the last stage.
1218 values { output vec4 out0 = vec4(11.0, 11.0, 9.0, 10.0); }
1221 precision mediump float;
1222 ${DECLARATIONS:single-line}
1223 #define BBB __LINE__, /*
1225 #define AAA(a,b) BBB, a, b
1229 out0 = vec4(AAA(__LINE__,
1238 values { output float out0 = 0.0; }
1240 precision mediump float;
1244 out0 = float(__FILE__);
1251 values { output float out0 = 1.0; }
1253 precision mediump float;
1268 values { output float out0 = 1.0; }
1270 precision mediump float;
1274 #if __VERSION__ == 100
1284 end # predefined_macros
1286 group conditional_inclusion "Conditional Inclusion Tests"
1289 values { output float out0 = 1.0; }
1291 precision mediump float;
1297 #if defined AAA && !defined(BBB)
1308 values { output float out0 = 1.0; }
1310 precision mediump float;
1314 #define AAA defined(BBB)
1327 values { output float out0 = 1.0; }
1329 precision mediump float;
1348 values { output float out0 = 1.0; }
1350 precision mediump float;
1367 values { output float out0 = 1.0; }
1369 precision mediump float;
1386 values { output float out0 = 1.0; }
1388 precision mediump float;
1392 #if !((~2 >> 1) & 1)
1403 values { output float out0 = 1.0; }
1405 precision mediump float;
1409 #if !((~(- - - - - 1 + + + + + +1) >> 1) & 1)
1419 end # conditional_inclusion
1421 group invalid_ops "Invalid Operations Tests"
1426 precision mediump float;
1429 #if !((~(+ ++1 - - - -1) >> 1) & 1)
1430 ${POSITION_FRAG_COLOR} = vec4(-1.0);
1432 ${POSITION_FRAG_COLOR} = vec4(1.0);
1441 precision mediump float;
1444 #if !((~(+ + +1 - -- -1) >> 1) & 1)
1445 ${POSITION_FRAG_COLOR} = vec4(-1.0);
1447 ${POSITION_FRAG_COLOR} = vec4(1.0);
1453 case invalid_defined_expected_identifier_1
1456 precision mediump float;
1462 ${POSITION_FRAG_COLOR} = vec4(1.0);
1468 case invalid_defined_expected_identifier_2
1471 precision mediump float;
1477 ${POSITION_FRAG_COLOR} = vec4(1.0);
1483 case invalid_defined_expected_identifier_3
1486 precision mediump float;
1492 ${POSITION_FRAG_COLOR} = vec4(1.0);
1498 case invalid_defined_expected_identifier_4
1501 precision mediump float;
1507 ${POSITION_FRAG_COLOR} = vec4(1.0);
1513 case invalid_defined_expected_identifier_5
1516 precision mediump float;
1522 ${POSITION_FRAG_COLOR} = vec4(FUNC(1.0,2.0);
1528 case invalid_defined_expected_rparen
1531 precision mediump float;
1537 ${POSITION_FRAG_COLOR} = vec4(1.0);
1544 values { output float out0 = 1.0; }
1546 precision mediump float;
1561 group undefined_identifiers "Undefined Identifiers Tests"
1563 case valid_undefined_identifier_1
1564 values { output float out0 = 1.0; }
1566 precision mediump float;
1580 case valid_undefined_identifier_2
1581 values { output float out0 = 1.0; }
1583 precision mediump float;
1597 case undefined_identifier_1
1600 precision mediump float;
1603 #if 1 - CCC + (-AAA || BBB)
1604 ${POSITION_FRAG_COLOR} = vec4(1.0);
1606 ${POSITION_FRAG_COLOR} = vec4(-1.0);
1612 case undefined_identifier_2
1615 precision mediump float;
1619 ${POSITION_FRAG_COLOR} = vec4(1.0);
1621 ${POSITION_FRAG_COLOR} = vec4(-1.0);
1627 case undefined_identifier_3
1630 precision mediump float;
1634 ${POSITION_FRAG_COLOR} = vec4(1.0);
1636 ${POSITION_FRAG_COLOR} = vec4(-1.0);
1642 case undefined_identifier_4
1645 precision mediump float;
1649 ${POSITION_FRAG_COLOR} = vec4(1.0);
1651 ${POSITION_FRAG_COLOR} = vec4(-1.0);
1657 case undefined_identifier_5
1660 precision mediump float;
1664 ${POSITION_FRAG_COLOR} = vec4(1.0);
1666 ${POSITION_FRAG_COLOR} = vec4(-1.0);
1672 case undefined_identifier_6
1675 precision mediump float;
1680 ${POSITION_FRAG_COLOR} = vec4(1.0);
1682 ${POSITION_FRAG_COLOR} = vec4(-1.0);
1688 case undefined_identifier_7
1691 precision mediump float;
1696 ${POSITION_FRAG_COLOR} = vec4(1.0);
1698 ${POSITION_FRAG_COLOR} = vec4(-1.0);
1704 case undefined_identifier_8
1707 precision mediump float;
1714 ${POSITION_FRAG_COLOR} = vec4(1.0);
1716 ${POSITION_FRAG_COLOR} = vec4(-1.0);
1722 case undefined_identifier_9
1725 precision mediump float;
1729 ${POSITION_FRAG_COLOR} = vec4(1.0);
1731 ${POSITION_FRAG_COLOR} = vec4(-1.0);
1737 case undefined_identifier_10
1740 precision mediump float;
1745 ${POSITION_FRAG_COLOR} = vec4(1.0);
1747 ${POSITION_FRAG_COLOR} = vec4(-1.0);
1753 case undefined_identifier_11
1756 precision mediump float;
1763 ${POSITION_FRAG_COLOR} = vec4(1.0);
1765 ${POSITION_FRAG_COLOR} = vec4(-1.0);
1771 case undefined_identifier_12
1774 precision mediump float;
1779 ${POSITION_FRAG_COLOR} = vec4(1.0);
1781 ${POSITION_FRAG_COLOR} = vec4(-1.0);
1787 end # undefined_identifiers
1789 group invalid_conditionals "Invalid Conditionals Tests"
1794 precision mediump float;
1798 ${POSITION_FRAG_COLOR} = vec4(1.0);
1806 precision mediump float;
1810 ${POSITION_FRAG_COLOR} = vec4(1.0);
1818 precision mediump float;
1822 ${POSITION_FRAG_COLOR} = vec4(1.0);
1827 case empty_if_defined
1830 precision mediump float;
1834 ${POSITION_FRAG_COLOR} = vec4(1.0);
1839 case unterminated_if_1
1842 precision mediump float;
1846 ${POSITION_FRAG_COLOR} = vec4(1.0);
1851 case unterminated_if_2
1854 precision mediump float;
1858 ${POSITION_FRAG_COLOR} = vec4(1.0);
1863 case unterminated_ifdef
1866 precision mediump float;
1870 ${POSITION_FRAG_COLOR} = vec4(1.0);
1875 case unterminated_ifndef
1878 precision mediump float;
1882 ${POSITION_FRAG_COLOR} = vec4(1.0);
1887 case unterminated_else_1
1890 precision mediump float;
1895 ${POSITION_FRAG_COLOR} = vec4(1.0);
1900 case unterminated_else_2
1903 precision mediump float;
1908 ${POSITION_FRAG_COLOR} = vec4(1.0);
1913 case unterminated_elif_1
1916 precision mediump float;
1921 ${POSITION_FRAG_COLOR} = vec4(1.0);
1926 case unterminated_elif_2
1929 precision mediump float;
1934 ${POSITION_FRAG_COLOR} = vec4(1.0);
1939 case unterminated_elif_3
1942 precision mediump float;
1947 ${POSITION_FRAG_COLOR} = vec4(2.0);
1952 case elif_after_else
1955 precision mediump float;
1959 ${POSITION_FRAG_COLOR} = vec4(1.0);
1961 ${POSITION_FRAG_COLOR} = vec4(-1.0);
1963 ${POSITION_FRAG_COLOR} = vec4(0.0);
1969 case else_without_if
1972 precision mediump float;
1976 ${POSITION_FRAG_COLOR} = vec4(1.0);
1982 case elif_without_if
1985 precision mediump float;
1989 ${POSITION_FRAG_COLOR} = vec4(1.0);
1995 case endif_without_if
1998 precision mediump float;
2001 ${POSITION_FRAG_COLOR} = vec4(1.0);
2007 case else_after_else
2010 precision mediump float;
2014 ${POSITION_FRAG_COLOR} = vec4(1.0);
2016 ${POSITION_FRAG_COLOR} = vec4(-1.0);
2018 ${POSITION_FRAG_COLOR} = vec4(-1.0);
2024 case nested_elif_without_if
2027 precision mediump float;
2031 ${POSITION_FRAG_COLOR} = vec4(1.0);
2033 ${POSITION_FRAG_COLOR} = vec4(0.0);
2043 precision mediump float;
2047 ${POSITION_FRAG_COLOR} = vec4(1.0);
2049 ${POSITION_FRAG_COLOR} = vec4(0.0);
2056 case tokens_after_if
2059 precision mediump float;
2063 ${POSITION_FRAG_COLOR} = vec4(1.0);
2069 case tokens_after_elif
2072 precision mediump float;
2077 ${POSITION_FRAG_COLOR} = vec4(1.0);
2083 case tokens_after_else
2086 precision mediump float;
2092 ${POSITION_FRAG_COLOR} = vec4(1.0);
2097 case tokens_after_endif
2100 precision mediump float;
2106 ${POSITION_FRAG_COLOR} = vec4(1.0);
2111 case tokens_after_ifdef
2114 precision mediump float;
2117 #ifdef FOOBAR foobar
2120 ${POSITION_FRAG_COLOR} = vec4(1.0);
2125 case tokens_after_ifndef
2128 precision mediump float;
2131 #ifndef FOOBAR ,, +- << barbar
2134 ${POSITION_FRAG_COLOR} = vec4(1.0);
2139 end # invalid_conditionals
2141 group conditionals "Conditionals Tests"
2143 case unterminated_nested_blocks
2146 precision mediump float;
2151 ${POSITION_FRAG_COLOR} = vec4(1.0);
2157 values { output float out0 = 1.0; }
2160 precision mediump float;
2175 values { output float out0 = 1.0; }
2178 precision mediump float;
2193 values { output float out0 = 1.0; }
2195 precision mediump float;
2212 precision mediump float;
2216 ${POSITION_FRAG_COLOR} = vec4(1.0);
2223 values { output float out0 = 1.0; }
2225 precision mediump float;
2240 values { output float out0 = 1.0; }
2242 precision mediump float;
2260 precision mediump float;
2264 ${POSITION_FRAG_COLOR} = vec4(1.0);
2270 case mixed_conditional_inclusion
2271 values { output float out0 = 1.0; }
2273 precision mediump float;
2288 values { output float out0 = 1.0; }
2290 precision mediump float;
2295 # if __VERSION__ != 100
2307 values { output float out0 = 1.0; }
2309 precision mediump float;
2332 values { output float out0 = 1.0; }
2334 precision mediump float;
2352 group directive "Directive Tests"
2355 values { output float out0 = 1.0; }
2359 precision mediump float;
2369 case version_is_less
2373 precision mediump float;
2376 ${POSITION_FRAG_COLOR} = vec4(1.0);
2381 case version_is_more
2385 precision mediump float;
2388 ${POSITION_FRAG_COLOR} = vec4(1.0);
2393 case version_missing
2397 precision mediump float;
2400 ${POSITION_FRAG_COLOR} = vec4(1.0);
2405 case version_not_first_statement_1
2408 precision mediump float;
2412 ${POSITION_FRAG_COLOR} = vec4(1.0);
2417 case version_not_first_statement_2
2422 precision mediump float;
2425 ${POSITION_FRAG_COLOR} = vec4(1.0);
2430 case version_invalid_token_1
2434 precision mediump float;
2437 ${POSITION_FRAG_COLOR} = vec4(1.0);
2442 case version_invalid_token_2
2446 precision mediump float;
2449 ${POSITION_FRAG_COLOR} = vec4(1.0);
2454 case invalid_version
2458 precision mediump float;
2461 ${POSITION_FRAG_COLOR} = vec4(1.0);
2466 case additional_tokens
2470 precision mediump float;
2473 ${POSITION_FRAG_COLOR} = vec4(1.0);
2478 case error_with_no_tokens
2482 precision mediump float;
2485 ${POSITION_FRAG_COLOR} = vec4(1.0);
2494 #error 1 * AAA /* comment */
2495 precision mediump float;
2498 ${POSITION_FRAG_COLOR} = vec4(1.0);
2505 group builtin "Built-in Symbol Tests"
2508 values { output float out0 = 1.0; }
2510 precision mediump float;
2515 out0 = float(__LINE__);
2522 values { output vec4 out0 = vec4(234.0, 234.0, 10.0, 10.0); }
2524 precision mediump float;
2529 out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__);
2535 case line_expression
2536 values { output float out0 = 20.0; }
2538 precision mediump float;
2543 out0 = float(__LINE__);
2549 case line_and_file_expression
2550 values { output vec4 out0 = vec4(243.0, 243.0, 10.0, 10.0); }
2552 precision mediump float;
2556 #line (233 +10) (+10)
2557 out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__);
2564 values { output float out0 = 4.0; }
2566 precision mediump float;
2572 out0 = float(__LINE__);
2579 values { output vec4 out0 = vec4(234.0, 234.0, 10.0, 10.0); }
2581 precision mediump float;
2587 out0 = vec4(__LINE__, __LINE__, __FILE__, __FILE__);
2596 precision mediump float;
2600 ${POSITION_FRAG_COLOR} = vec4(1.0);
2605 case invalid_line_file_1
2608 precision mediump float;
2612 ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__);
2617 case invalid_line_file_3
2620 precision mediump float;
2624 ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__);
2629 case invalid_line_file_4
2632 precision mediump float;
2636 ${POSITION_FRAG_COLOR} = vec4(__LINE__, __LINE__, __FILE__, __FILE__);
2643 group pragmas "Pragma Tests"
2646 values { output float out0 = 1.0; }
2650 #pragma STDGL invariant(all)
2652 #pragma optimize(off)
2654 precision mediump float;
2655 ${VERTEX_DECLARATIONS}
2656 varying float v_val;
2664 precision mediump float;
2665 ${FRAGMENT_DECLARATIONS}
2666 invariant varying float v_val;
2675 case pragma_fragment
2676 values { output float out0 = 1.0; }
2679 precision mediump float;
2680 ${VERTEX_DECLARATIONS}
2681 varying float v_val;
2690 #pragma STDGL invariant(all)
2692 #pragma optimize(off)
2694 precision mediump float;
2695 ${FRAGMENT_DECLARATIONS}
2696 varying float v_val;
2705 case pragma_macro_exp
2706 values { output float out0 = 1.0; }
2709 /* pragma line not macro expanded */
2712 precision mediump float;
2722 case pragma_unrecognized_debug
2723 expect build_successful
2727 // unrecognized preprocessor token
2729 precision mediump float;
2732 ${POSITION_FRAG_COLOR} = vec4(1.0);
2737 case pragma_unrecognized_token
2738 expect build_successful
2742 // trailing bytes form a valid but unrecognized preprocessor token
2744 precision mediump float;
2747 ${POSITION_FRAG_COLOR} = vec4(1.0);
2754 group extensions "Extension Tests"
2757 values { output float out0 = 1.0; }
2759 #extension all : warn
2761 precision mediump float;
2772 values { output float out0 = 1.0; }
2776 #extension all : warn
2778 precision mediump float;
2788 case missing_extension_name
2792 precision mediump float;
2795 ${POSITION_FRAG_COLOR} = vec4(1.0);
2800 case invalid_extension_name
2804 precision mediump float;
2807 ${POSITION_FRAG_COLOR} = vec4(1.0);
2816 precision mediump float;
2819 ${POSITION_FRAG_COLOR} = vec4(1.0);
2828 precision mediump float;
2831 ${POSITION_FRAG_COLOR} = vec4(1.0);
2836 case missing_behavior
2840 precision mediump float;
2843 ${POSITION_FRAG_COLOR} = vec4(1.0);
2848 case invalid_behavior_1
2851 #extension all : WARN
2852 precision mediump float;
2855 ${POSITION_FRAG_COLOR} = vec4(1.0);
2860 case invalid_behavior_2
2863 #extension all : require
2864 precision mediump float;
2867 ${POSITION_FRAG_COLOR} = vec4(1.0);
2872 case invalid_char_in_name
2875 #extension all¤ : warn
2876 precision mediump float;
2879 ${POSITION_FRAG_COLOR} = vec4(1.0);
2884 case invalid_char_in_behavior
2887 #extension all : war¤n
2888 precision mediump float;
2891 ${POSITION_FRAG_COLOR} = vec4(1.0);
2896 case unterminated_comment
2899 #extension all : warn /*asd
2900 precision mediump float;
2903 ${POSITION_FRAG_COLOR} = vec4(1.0);
2908 case after_non_preprocessing_tokens
2911 #extension all : warn
2913 precision mediump float;
2917 #extension all : disable
2918 ${POSITION_FRAG_COLOR} = vec4(1.0);
2924 group expressions "Expression Tests"
2927 values { output float out0 = 1.0; }
2929 precision mediump float;
2935 #if (VAL << 2) == 16
2944 values { output float out0 = 1.0; }
2946 precision mediump float;
2961 values { output float out0 = 1.0; }
2963 precision mediump float;
2969 #if (VAL < 6) && (-VAL < -4)
2978 values { output float out0 = 1.0; }
2980 precision mediump float;
2986 #if (VAL <= 6) && (-VAL <= -6)
2995 values { output float out0 = 1.0; }
2997 precision mediump float;
3012 values { output float out0 = 1.0; }
3014 precision mediump float;
3029 values { output float out0 = 1.0; }
3031 precision mediump float;
3046 values { output float out0 = 1.0; }
3048 precision mediump float;
3062 case parenthesis_value
3063 values { output float out0 = 1.0; }
3065 precision mediump float;
3069 #define VAL (( (4 ) ) )
3079 case parenthesis_tricky
3080 values { output float out0 = 1.0; }
3082 precision mediump float;
3086 #define VAL (( (4 ) )
3096 case parenthesis_if_no
3097 values { output float out0 = 1.0; }
3099 precision mediump float;
3114 values { output float out0 = 1.0; }
3116 precision mediump float;
3130 case parenthesis_multi_if
3131 values { output float out0 = 1.0; }
3133 precision mediump float;
3139 #if (((VAL)) >= (4))
3147 case parenthesis_single_if
3148 values { output float out0 = 1.0; }
3150 precision mediump float;
3164 case parenthesis_ifelse_true
3165 values { output float out0 = 1.0; }
3167 precision mediump float;
3182 case parenthesis_ifelse_false
3183 values { output float out0 = 1.0; }
3185 precision mediump float;
3201 values { output float out0 = 1.0; }
3203 precision mediump float;
3218 values { output float out0 = 1.0; }
3220 precision mediump float;
3224 #if (2 * 2) - 3 >= 0
3234 case eval_simple_precedence_0
3235 values { output float out0 = 1.0; }
3237 precision mediump float;
3251 case eval_simple_precedence_1
3252 values { output float out0 = 1.0; }
3254 precision mediump float;
3269 values { output float out0 = 1.0; }
3271 precision mediump float;
3287 values { output float out0 = 1.0; }
3289 precision mediump float;
3306 values { output float out0 = 1.0; }
3308 precision mediump float;
3314 #if defined(X) && defined(Y)
3325 values { output float out0 = 1.0; }
3327 precision mediump float;
3334 #if defined(X) && defined(Y)
3345 values { output float out0 = 1.0; }
3347 precision mediump float;
3354 #if defined(X) || defined(Y)
3365 values { output float out0 = 1.0; }
3367 precision mediump float;
3374 #if defined(X) && (defined(Y) || (X == 0))
3386 group invalid_expressions "Invalid Expression Tests"
3388 case invalid_unary_expr
3391 precision mediump float;
3395 ${POSITION_FRAG_COLOR} = vec4(1.0);
3400 case invalid_binary_expr
3403 precision mediump float;
3407 ${POSITION_FRAG_COLOR} = vec4(1.0);
3415 precision mediump float;
3419 ${POSITION_FRAG_COLOR} = vec4(1.0);
3427 precision mediump float;
3431 ${POSITION_FRAG_COLOR} = vec4(1.0);
3439 precision mediump float;
3443 ${POSITION_FRAG_COLOR} = vec4(1.0);
3451 precision mediump float;
3455 ${POSITION_FRAG_COLOR} = vec4(1.0);
3460 case unopened_parenthesis
3463 precision mediump float;
3467 ${POSITION_FRAG_COLOR} = vec4(1.0);
3472 case unclosed_parenthesis
3475 precision mediump float;
3479 ${POSITION_FRAG_COLOR} = vec4(1.0);
3484 end # invalid_expressions
3486 group operator_precedence "Operator precedence"
3490 values { output float out0 = 1.0; }
3493 #if ( 8 % ! 0 ) == 0
3498 precision mediump float;
3509 values { output float out0 = 1.0; }
3512 #if ( 8 / ! 0 ) == 8
3517 precision mediump float;
3528 values { output float out0 = 1.0; }
3531 #if ( 8 * ! 0 ) == 8
3536 precision mediump float;
3546 case modulo_vs_bit_invert
3547 values { output float out0 = 1.0; }
3550 #if ( 8 % ~ 4 ) == 3
3555 precision mediump float;
3565 case modulo_vs_minus
3566 values { output float out0 = 1.0; }
3569 #if ( 8 % - 2 ) == 0
3574 precision mediump float;
3585 values { output float out0 = 1.0; }
3588 #if ( 8 % + 2 ) == 0
3593 precision mediump float;
3603 case div_vs_bit_invert
3604 values { output float out0 = 1.0; }
3607 #if ( 8 / ~ 2 ) == -2
3612 precision mediump float;
3623 values { output float out0 = 1.0; }
3626 #if ( 8 / - 2 ) == -4
3631 precision mediump float;
3642 values { output float out0 = 1.0; }
3645 #if ( 8 / + 2 ) == 4
3650 precision mediump float;
3660 case mul_vs_bit_invert
3661 values { output float out0 = 1.0; }
3664 #if ( 8 * ~ 2 ) == -24
3669 precision mediump float;
3680 values { output float out0 = 1.0; }
3683 #if ( 8 * - 2 ) == -16
3688 precision mediump float;
3699 values { output float out0 = 1.0; }
3702 #if ( 8 * + 2 ) == 16
3707 precision mediump float;
3718 values { output float out0 = 1.0; }
3721 #if ( 8 - 3 % 2 ) == 7
3726 precision mediump float;
3737 values { output float out0 = 1.0; }
3740 #if ( 8 - 3 / 2 ) == 7
3745 precision mediump float;
3756 values { output float out0 = 1.0; }
3759 #if ( 8 - 3 * 2 ) == 2
3764 precision mediump float;
3775 values { output float out0 = 1.0; }
3778 #if ( 8 + 3 % 2 ) == 9
3783 precision mediump float;
3794 values { output float out0 = 1.0; }
3797 #if ( 8 + 3 / 2 ) == 9
3802 precision mediump float;
3813 values { output float out0 = 1.0; }
3816 #if ( 8 + 3 * 2 ) == 14
3821 precision mediump float;
3832 values { output float out0 = 1.0; }
3835 #if ( 8 >> 3 - 2 ) == 4
3840 precision mediump float;
3851 values { output float out0 = 1.0; }
3854 #if ( 8 >> 3 + 2 ) == 0
3859 precision mediump float;
3870 values { output float out0 = 1.0; }
3873 #if ( 8 << 3 - 2 ) == 16
3878 precision mediump float;
3889 values { output float out0 = 1.0; }
3892 #if ( 8 << 3 + 2 ) == 256
3897 precision mediump float;
3907 case greater_or_equal_vs_rshift
3908 values { output float out0 = 1.0; }
3911 #if ( 8 >= 3 >> 2 ) == 1
3916 precision mediump float;
3926 case greater_or_equal_vs_lshift
3927 values { output float out0 = 1.0; }
3930 #if ( 8 >= 3 << 2 ) == 0
3935 precision mediump float;
3945 case less_or_equal_vs_rshift
3946 values { output float out0 = 1.0; }
3949 #if ( 8 <= 3 >> 2 ) == 0
3954 precision mediump float;
3964 case less_or_equal_vs_lshift
3965 values { output float out0 = 1.0; }
3968 #if ( 8 <= 3 << 2 ) == 1
3973 precision mediump float;
3983 case greater_vs_rshift
3984 values { output float out0 = 1.0; }
3987 #if ( 8 > 3 >> 2 ) == 1
3992 precision mediump float;
4002 case greater_vs_lshift
4003 values { output float out0 = 1.0; }
4006 #if ( 8 > 3 << 2 ) == 0
4011 precision mediump float;
4022 values { output float out0 = 1.0; }
4025 #if ( 8 < 3 >> 2 ) == 0
4030 precision mediump float;
4041 values { output float out0 = 1.0; }
4044 #if ( 8 < 3 << 2 ) == 1
4049 precision mediump float;
4059 case not_equal_vs_greater_or_equal
4060 values { output float out0 = 1.0; }
4063 #if ( 8 != 3 >= 2 ) == 1
4068 precision mediump float;
4078 case not_equal_vs_less_or_equal
4079 values { output float out0 = 1.0; }
4082 #if ( 8 != 3 <= 2 ) == 1
4087 precision mediump float;
4097 case not_equal_vs_greater
4098 values { output float out0 = 1.0; }
4101 #if ( 8 != 3 > 2 ) == 1
4106 precision mediump float;
4116 case not_equal_vs_less
4117 values { output float out0 = 1.0; }
4120 #if ( 8 != 3 < 2 ) == 1
4125 precision mediump float;
4135 case equal_vs_greater_or_equal
4136 values { output float out0 = 1.0; }
4139 #if ( 8 == 3 >= 2 ) == 0
4144 precision mediump float;
4154 case equal_vs_less_or_equal
4155 values { output float out0 = 1.0; }
4158 #if ( 8 == 3 <= 2 ) == 0
4163 precision mediump float;
4173 case equal_vs_greater
4174 values { output float out0 = 1.0; }
4177 #if ( 8 == 3 > 2 ) == 0
4182 precision mediump float;
4193 values { output float out0 = 1.0; }
4196 #if ( 8 == 3 < 2 ) == 0
4201 precision mediump float;
4211 case bitwise_and_vs_not_equal
4212 values { output float out0 = 1.0; }
4215 #if ( 8 & 3 != 2 ) == 0
4220 precision mediump float;
4230 case bitwise_and_vs_equal
4231 values { output float out0 = 1.0; }
4234 #if ( 8 & 3 == 2 ) == 0
4239 precision mediump float;
4249 case xor_vs_bitwise_and
4250 values { output float out0 = 1.0; }
4253 #if ( 8 ^ 3 & 2 ) == 10
4258 precision mediump float;
4268 case bitwise_or_vs_xor
4269 values { output float out0 = 1.0; }
4272 #if ( 8 | 3 ^ 2 ) == 9
4277 precision mediump float;
4287 case logical_and_vs_bitwise_or
4288 values { output float out0 = 1.0; }
4296 precision mediump float;
4306 case logical_and_vs_bitwise_and
4307 values { output float out0 = 1.0; }
4315 precision mediump float;
4325 case logical_or_vs_logical_and
4326 values { output float out0 = 1.0; }
4334 precision mediump float;
4344 end # operator_precedence