| ... | @@ -643,11 +643,11 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -643,11 +643,11 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 643 | \\pub export fn max(a: c_int) void { | 643 | \\pub export fn max(a: c_int) void { |
| 644 | \\ var b: c_int = undefined; | 644 | \\ var b: c_int = undefined; |
| 645 | \\ var c: c_int = undefined; | 645 | \\ var c: c_int = undefined; |
| 646 | \\ c = x: { | 646 | \\ c = (x: { |
| 647 | \\ const _tmp = a; | 647 | \\ const _tmp = a; |
| 648 | \\ b = _tmp; | 648 | \\ b = _tmp; |
| 649 | \\ break :x _tmp; | 649 | \\ break :x _tmp; |
| 650 | \\ }; | 650 | \\ }); |
| 651 | \\} | 651 | \\} |
| 652 | ); | 652 | ); |
| 653 | | 653 | |
| ... | @@ -820,46 +820,46 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -820,46 +820,46 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 820 | , | 820 | , |
| 821 | \\pub export fn foo() void { | 821 | \\pub export fn foo() void { |
| 822 | \\ var a: c_int = 0; | 822 | \\ var a: c_int = 0; |
| 823 | \\ a += x: { | 823 | \\ a += (x: { |
| 824 | \\ const _ref = &a; | 824 | \\ const _ref = &a; |
| 825 | \\ _ref.* = (_ref.* + 1); | 825 | \\ _ref.* = (_ref.* + 1); |
| 826 | \\ break :x _ref.*; | 826 | \\ break :x _ref.*; |
| 827 | \\ }; | 827 | \\ }); |
| 828 | \\ a -= x: { | 828 | \\ a -= (x: { |
| 829 | \\ const _ref = &a; | 829 | \\ const _ref = &a; |
| 830 | \\ _ref.* = (_ref.* - 1); | 830 | \\ _ref.* = (_ref.* - 1); |
| 831 | \\ break :x _ref.*; | 831 | \\ break :x _ref.*; |
| 832 | \\ }; | 832 | \\ }); |
| 833 | \\ a *= x: { | 833 | \\ a *= (x: { |
| 834 | \\ const _ref = &a; | 834 | \\ const _ref = &a; |
| 835 | \\ _ref.* = (_ref.* * 1); | 835 | \\ _ref.* = (_ref.* * 1); |
| 836 | \\ break :x _ref.*; | 836 | \\ break :x _ref.*; |
| 837 | \\ }; | 837 | \\ }); |
| 838 | \\ a &= x: { | 838 | \\ a &= (x: { |
| 839 | \\ const _ref = &a; | 839 | \\ const _ref = &a; |
| 840 | \\ _ref.* = (_ref.* & 1); | 840 | \\ _ref.* = (_ref.* & 1); |
| 841 | \\ break :x _ref.*; | 841 | \\ break :x _ref.*; |
| 842 | \\ }; | 842 | \\ }); |
| 843 | \\ a |= x: { | 843 | \\ a |= (x: { |
| 844 | \\ const _ref = &a; | 844 | \\ const _ref = &a; |
| 845 | \\ _ref.* = (_ref.* | 1); | 845 | \\ _ref.* = (_ref.* | 1); |
| 846 | \\ break :x _ref.*; | 846 | \\ break :x _ref.*; |
| 847 | \\ }; | 847 | \\ }); |
| 848 | \\ a ^= x: { | 848 | \\ a ^= (x: { |
| 849 | \\ const _ref = &a; | 849 | \\ const _ref = &a; |
| 850 | \\ _ref.* = (_ref.* ^ 1); | 850 | \\ _ref.* = (_ref.* ^ 1); |
| 851 | \\ break :x _ref.*; | 851 | \\ break :x _ref.*; |
| 852 | \\ }; | 852 | \\ }); |
| 853 | \\ a >>= @import("std").math.Log2Int(c_int)(x: { | 853 | \\ a >>= @import("std").math.Log2Int(c_int)((x: { |
| 854 | \\ const _ref = &a; | 854 | \\ const _ref = &a; |
| 855 | \\ _ref.* = (_ref.* >> @import("std").math.Log2Int(c_int)(1)); | 855 | \\ _ref.* = (_ref.* >> @import("std").math.Log2Int(c_int)(1)); |
| 856 | \\ break :x _ref.*; | 856 | \\ break :x _ref.*; |
| 857 | \\ }); | 857 | \\ })); |
| 858 | \\ a <<= @import("std").math.Log2Int(c_int)(x: { | 858 | \\ a <<= @import("std").math.Log2Int(c_int)((x: { |
| 859 | \\ const _ref = &a; | 859 | \\ const _ref = &a; |
| 860 | \\ _ref.* = (_ref.* << @import("std").math.Log2Int(c_int)(1)); | 860 | \\ _ref.* = (_ref.* << @import("std").math.Log2Int(c_int)(1)); |
| 861 | \\ break :x _ref.*; | 861 | \\ break :x _ref.*; |
| 862 | \\ }); | 862 | \\ })); |
| 863 | \\} | 863 | \\} |
| 864 | ); | 864 | ); |
| 865 | | 865 | |
| ... | @@ -878,46 +878,46 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -878,46 +878,46 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 878 | , | 878 | , |
| 879 | \\pub export fn foo() void { | 879 | \\pub export fn foo() void { |
| 880 | \\ var a: c_uint = c_uint(0); | 880 | \\ var a: c_uint = c_uint(0); |
| 881 | \\ a +%= x: { | 881 | \\ a +%= (x: { |
| 882 | \\ const _ref = &a; | 882 | \\ const _ref = &a; |
| 883 | \\ _ref.* = (_ref.* +% c_uint(1)); | 883 | \\ _ref.* = (_ref.* +% c_uint(1)); |
| 884 | \\ break :x _ref.*; | 884 | \\ break :x _ref.*; |
| 885 | \\ }; | 885 | \\ }); |
| 886 | \\ a -%= x: { | 886 | \\ a -%= (x: { |
| 887 | \\ const _ref = &a; | 887 | \\ const _ref = &a; |
| 888 | \\ _ref.* = (_ref.* -% c_uint(1)); | 888 | \\ _ref.* = (_ref.* -% c_uint(1)); |
| 889 | \\ break :x _ref.*; | 889 | \\ break :x _ref.*; |
| 890 | \\ }; | 890 | \\ }); |
| 891 | \\ a *%= x: { | 891 | \\ a *%= (x: { |
| 892 | \\ const _ref = &a; | 892 | \\ const _ref = &a; |
| 893 | \\ _ref.* = (_ref.* *% c_uint(1)); | 893 | \\ _ref.* = (_ref.* *% c_uint(1)); |
| 894 | \\ break :x _ref.*; | 894 | \\ break :x _ref.*; |
| 895 | \\ }; | 895 | \\ }); |
| 896 | \\ a &= x: { | 896 | \\ a &= (x: { |
| 897 | \\ const _ref = &a; | 897 | \\ const _ref = &a; |
| 898 | \\ _ref.* = (_ref.* & c_uint(1)); | 898 | \\ _ref.* = (_ref.* & c_uint(1)); |
| 899 | \\ break :x _ref.*; | 899 | \\ break :x _ref.*; |
| 900 | \\ }; | 900 | \\ }); |
| 901 | \\ a |= x: { | 901 | \\ a |= (x: { |
| 902 | \\ const _ref = &a; | 902 | \\ const _ref = &a; |
| 903 | \\ _ref.* = (_ref.* | c_uint(1)); | 903 | \\ _ref.* = (_ref.* | c_uint(1)); |
| 904 | \\ break :x _ref.*; | 904 | \\ break :x _ref.*; |
| 905 | \\ }; | 905 | \\ }); |
| 906 | \\ a ^= x: { | 906 | \\ a ^= (x: { |
| 907 | \\ const _ref = &a; | 907 | \\ const _ref = &a; |
| 908 | \\ _ref.* = (_ref.* ^ c_uint(1)); | 908 | \\ _ref.* = (_ref.* ^ c_uint(1)); |
| 909 | \\ break :x _ref.*; | 909 | \\ break :x _ref.*; |
| 910 | \\ }; | 910 | \\ }); |
| 911 | \\ a >>= @import("std").math.Log2Int(c_uint)(x: { | 911 | \\ a >>= @import("std").math.Log2Int(c_uint)((x: { |
| 912 | \\ const _ref = &a; | 912 | \\ const _ref = &a; |
| 913 | \\ _ref.* = (_ref.* >> @import("std").math.Log2Int(c_uint)(1)); | 913 | \\ _ref.* = (_ref.* >> @import("std").math.Log2Int(c_uint)(1)); |
| 914 | \\ break :x _ref.*; | 914 | \\ break :x _ref.*; |
| 915 | \\ }); | 915 | \\ })); |
| 916 | \\ a <<= @import("std").math.Log2Int(c_uint)(x: { | 916 | \\ a <<= @import("std").math.Log2Int(c_uint)((x: { |
| 917 | \\ const _ref = &a; | 917 | \\ const _ref = &a; |
| 918 | \\ _ref.* = (_ref.* << @import("std").math.Log2Int(c_uint)(1)); | 918 | \\ _ref.* = (_ref.* << @import("std").math.Log2Int(c_uint)(1)); |
| 919 | \\ break :x _ref.*; | 919 | \\ break :x _ref.*; |
| 920 | \\ }); | 920 | \\ })); |
| 921 | \\} | 921 | \\} |
| 922 | ); | 922 | ); |
| 923 | | 923 | |
| ... | @@ -953,30 +953,30 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -953,30 +953,30 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 953 | \\ i -= 1; | 953 | \\ i -= 1; |
| 954 | \\ u +%= 1; | 954 | \\ u +%= 1; |
| 955 | \\ u -%= 1; | 955 | \\ u -%= 1; |
| 956 | \\ i = x: { | 956 | \\ i = (x: { |
| 957 | \\ const _ref = &i; | 957 | \\ const _ref = &i; |
| 958 | \\ const _tmp = _ref.*; | 958 | \\ const _tmp = _ref.*; |
| 959 | \\ _ref.* += 1; | 959 | \\ _ref.* += 1; |
| 960 | \\ break :x _tmp; | 960 | \\ break :x _tmp; |
| 961 | \\ }; | 961 | \\ }); |
| 962 | \\ i = x: { | 962 | \\ i = (x: { |
| 963 | \\ const _ref = &i; | 963 | \\ const _ref = &i; |
| 964 | \\ const _tmp = _ref.*; | 964 | \\ const _tmp = _ref.*; |
| 965 | \\ _ref.* -= 1; | 965 | \\ _ref.* -= 1; |
| 966 | \\ break :x _tmp; | 966 | \\ break :x _tmp; |
| 967 | \\ }; | 967 | \\ }); |
| 968 | \\ u = x: { | 968 | \\ u = (x: { |
| 969 | \\ const _ref = &u; | 969 | \\ const _ref = &u; |
| 970 | \\ const _tmp = _ref.*; | 970 | \\ const _tmp = _ref.*; |
| 971 | \\ _ref.* +%= 1; | 971 | \\ _ref.* +%= 1; |
| 972 | \\ break :x _tmp; | 972 | \\ break :x _tmp; |
| 973 | \\ }; | 973 | \\ }); |
| 974 | \\ u = x: { | 974 | \\ u = (x: { |
| 975 | \\ const _ref = &u; | 975 | \\ const _ref = &u; |
| 976 | \\ const _tmp = _ref.*; | 976 | \\ const _tmp = _ref.*; |
| 977 | \\ _ref.* -%= 1; | 977 | \\ _ref.* -%= 1; |
| 978 | \\ break :x _tmp; | 978 | \\ break :x _tmp; |
| 979 | \\ }; | 979 | \\ }); |
| 980 | \\} | 980 | \\} |
| 981 | ); | 981 | ); |
| 982 | | 982 | |
| ... | @@ -1001,26 +1001,26 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -1001,26 +1001,26 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 1001 | \\ i -= 1; | 1001 | \\ i -= 1; |
| 1002 | \\ u +%= 1; | 1002 | \\ u +%= 1; |
| 1003 | \\ u -%= 1; | 1003 | \\ u -%= 1; |
| 1004 | \\ i = x: { | 1004 | \\ i = (x: { |
| 1005 | \\ const _ref = &i; | 1005 | \\ const _ref = &i; |
| 1006 | \\ _ref.* += 1; | 1006 | \\ _ref.* += 1; |
| 1007 | \\ break :x _ref.*; | 1007 | \\ break :x _ref.*; |
| 1008 | \\ }; | 1008 | \\ }); |
| 1009 | \\ i = x: { | 1009 | \\ i = (x: { |
| 1010 | \\ const _ref = &i; | 1010 | \\ const _ref = &i; |
| 1011 | \\ _ref.* -= 1; | 1011 | \\ _ref.* -= 1; |
| 1012 | \\ break :x _ref.*; | 1012 | \\ break :x _ref.*; |
| 1013 | \\ }; | 1013 | \\ }); |
| 1014 | \\ u = x: { | 1014 | \\ u = (x: { |
| 1015 | \\ const _ref = &u; | 1015 | \\ const _ref = &u; |
| 1016 | \\ _ref.* +%= 1; | 1016 | \\ _ref.* +%= 1; |
| 1017 | \\ break :x _ref.*; | 1017 | \\ break :x _ref.*; |
| 1018 | \\ }; | 1018 | \\ }); |
| 1019 | \\ u = x: { | 1019 | \\ u = (x: { |
| 1020 | \\ const _ref = &u; | 1020 | \\ const _ref = &u; |
| 1021 | \\ _ref.* -%= 1; | 1021 | \\ _ref.* -%= 1; |
| 1022 | \\ break :x _ref.*; | 1022 | \\ break :x _ref.*; |
| 1023 | \\ }; | 1023 | \\ }); |
| 1024 | \\} | 1024 | \\} |
| 1025 | ); | 1025 | ); |
| 1026 | | 1026 | |