authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-03-24 20:58:38-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-03-24 20:58:38-07:00
log12d18a36e5eed4b0898e93df2fd13b56061049b3
tree8ef105a3cbedc2bdfa962acb553cd6d0cab2856c
parent01bfd835bb9613d21f09c0c4f5b905b077b3d5f9

stage2: enable passing tests


1 files changed, 185 insertions(+), 185 deletions(-)

test/stage2/test.zig+185-185
...@@ -622,197 +622,197 @@ pub fn addCases(ctx: *TestContext) !void {...@@ -622,197 +622,197 @@ pub fn addCases(ctx: *TestContext) !void {
622 );622 );
623623
624 // Labeled blocks (no conditional branch)624 // Labeled blocks (no conditional branch)
625 //case.addCompareOutput(625 case.addCompareOutput(
626 // \\export fn _start() noreturn {626 \\export fn _start() noreturn {
627 // \\ assert(add(3, 4) == 20);627 \\ assert(add(3, 4) == 20);
628 // \\628 \\
629 // \\ exit();629 \\ exit();
630 // \\}630 \\}
631 // \\631 \\
632 // \\fn add(a: u32, b: u32) u32 {632 \\fn add(a: u32, b: u32) u32 {
633 // \\ const x: u32 = blk: {633 \\ const x: u32 = blk: {
634 // \\ const c = a + b; // 7634 \\ const c = a + b; // 7
635 // \\ const d = a + c; // 10635 \\ const d = a + c; // 10
636 // \\ const e = d + b; // 14636 \\ const e = d + b; // 14
637 // \\ break :blk e;637 \\ break :blk e;
638 // \\ };638 \\ };
639 // \\ const y = x + a; // 17639 \\ const y = x + a; // 17
640 // \\ const z = y + a; // 20640 \\ const z = y + a; // 20
641 // \\ return z;641 \\ return z;
642 // \\}642 \\}
643 // \\643 \\
644 // \\pub fn assert(ok: bool) void {644 \\pub fn assert(ok: bool) void {
645 // \\ if (!ok) unreachable; // assertion failure645 \\ if (!ok) unreachable; // assertion failure
646 // \\}646 \\}
647 // \\647 \\
648 // \\fn exit() noreturn {648 \\fn exit() noreturn {
649 // \\ asm volatile ("syscall"649 \\ asm volatile ("syscall"
650 // \\ :650 \\ :
651 // \\ : [number] "{rax}" (231),651 \\ : [number] "{rax}" (231),
652 // \\ [arg1] "{rdi}" (0)652 \\ [arg1] "{rdi}" (0)
653 // \\ : "rcx", "r11", "memory"653 \\ : "rcx", "r11", "memory"
654 // \\ );654 \\ );
655 // \\ unreachable;655 \\ unreachable;
656 // \\}656 \\}
657 //,657 ,
658 // "",658 "",
659 //);659 );
660660
661 // This catches a possible bug in the logic for re-using dying operands.661 // This catches a possible bug in the logic for re-using dying operands.
662 //case.addCompareOutput(662 case.addCompareOutput(
663 // \\export fn _start() noreturn {663 \\export fn _start() noreturn {
664 // \\ assert(add(3, 4) == 116);664 \\ assert(add(3, 4) == 116);
665 // \\665 \\
666 // \\ exit();666 \\ exit();
667 // \\}667 \\}
668 // \\668 \\
669 // \\fn add(a: u32, b: u32) u32 {669 \\fn add(a: u32, b: u32) u32 {
670 // \\ const x: u32 = blk: {670 \\ const x: u32 = blk: {
671 // \\ const c = a + b; // 7671 \\ const c = a + b; // 7
672 // \\ const d = a + c; // 10672 \\ const d = a + c; // 10
673 // \\ const e = d + b; // 14673 \\ const e = d + b; // 14
674 // \\ const f = d + e; // 24674 \\ const f = d + e; // 24
675 // \\ const g = e + f; // 38675 \\ const g = e + f; // 38
676 // \\ const h = f + g; // 62676 \\ const h = f + g; // 62
677 // \\ const i = g + h; // 100677 \\ const i = g + h; // 100
678 // \\ const j = i + d; // 110678 \\ const j = i + d; // 110
679 // \\ break :blk j;679 \\ break :blk j;
680 // \\ };680 \\ };
681 // \\ const y = x + a; // 113681 \\ const y = x + a; // 113
682 // \\ const z = y + a; // 116682 \\ const z = y + a; // 116
683 // \\ return z;683 \\ return z;
684 // \\}684 \\}
685 // \\685 \\
686 // \\pub fn assert(ok: bool) void {686 \\pub fn assert(ok: bool) void {
687 // \\ if (!ok) unreachable; // assertion failure687 \\ if (!ok) unreachable; // assertion failure
688 // \\}688 \\}
689 // \\689 \\
690 // \\fn exit() noreturn {690 \\fn exit() noreturn {
691 // \\ asm volatile ("syscall"691 \\ asm volatile ("syscall"
692 // \\ :692 \\ :
693 // \\ : [number] "{rax}" (231),693 \\ : [number] "{rax}" (231),
694 // \\ [arg1] "{rdi}" (0)694 \\ [arg1] "{rdi}" (0)
695 // \\ : "rcx", "r11", "memory"695 \\ : "rcx", "r11", "memory"
696 // \\ );696 \\ );
697 // \\ unreachable;697 \\ unreachable;
698 // \\}698 \\}
699 //,699 ,
700 // "",700 "",
701 //);701 );
702702
703 // Spilling registers to the stack.703 // Spilling registers to the stack.
704 //case.addCompareOutput(704 case.addCompareOutput(
705 // \\export fn _start() noreturn {705 \\export fn _start() noreturn {
706 // \\ assert(add(3, 4) == 791);706 \\ assert(add(3, 4) == 791);
707 // \\707 \\
708 // \\ exit();708 \\ exit();
709 // \\}709 \\}
710 // \\710 \\
711 // \\fn add(a: u32, b: u32) u32 {711 \\fn add(a: u32, b: u32) u32 {
712 // \\ const x: u32 = blk: {712 \\ const x: u32 = blk: {
713 // \\ const c = a + b; // 7713 \\ const c = a + b; // 7
714 // \\ const d = a + c; // 10714 \\ const d = a + c; // 10
715 // \\ const e = d + b; // 14715 \\ const e = d + b; // 14
716 // \\ const f = d + e; // 24716 \\ const f = d + e; // 24
717 // \\ const g = e + f; // 38717 \\ const g = e + f; // 38
718 // \\ const h = f + g; // 62718 \\ const h = f + g; // 62
719 // \\ const i = g + h; // 100719 \\ const i = g + h; // 100
720 // \\ const j = i + d; // 110720 \\ const j = i + d; // 110
721 // \\ const k = i + j; // 210721 \\ const k = i + j; // 210
722 // \\ const l = k + c; // 217722 \\ const l = k + c; // 217
723 // \\ const m = l + d; // 227723 \\ const m = l + d; // 227
724 // \\ const n = m + e; // 241724 \\ const n = m + e; // 241
725 // \\ const o = n + f; // 265725 \\ const o = n + f; // 265
726 // \\ const p = o + g; // 303726 \\ const p = o + g; // 303
727 // \\ const q = p + h; // 365727 \\ const q = p + h; // 365
728 // \\ const r = q + i; // 465728 \\ const r = q + i; // 465
729 // \\ const s = r + j; // 575729 \\ const s = r + j; // 575
730 // \\ const t = s + k; // 785730 \\ const t = s + k; // 785
731 // \\ break :blk t;731 \\ break :blk t;
732 // \\ };732 \\ };
733 // \\ const y = x + a; // 788733 \\ const y = x + a; // 788
734 // \\ const z = y + a; // 791734 \\ const z = y + a; // 791
735 // \\ return z;735 \\ return z;
736 // \\}736 \\}
737 // \\737 \\
738 // \\pub fn assert(ok: bool) void {738 \\pub fn assert(ok: bool) void {
739 // \\ if (!ok) unreachable; // assertion failure739 \\ if (!ok) unreachable; // assertion failure
740 // \\}740 \\}
741 // \\741 \\
742 // \\fn exit() noreturn {742 \\fn exit() noreturn {
743 // \\ asm volatile ("syscall"743 \\ asm volatile ("syscall"
744 // \\ :744 \\ :
745 // \\ : [number] "{rax}" (231),745 \\ : [number] "{rax}" (231),
746 // \\ [arg1] "{rdi}" (0)746 \\ [arg1] "{rdi}" (0)
747 // \\ : "rcx", "r11", "memory"747 \\ : "rcx", "r11", "memory"
748 // \\ );748 \\ );
749 // \\ unreachable;749 \\ unreachable;
750 // \\}750 \\}
751 //,751 ,
752 // "",752 "",
753 //);753 );
754754
755 // Reusing the registers of dead operands playing nicely with conditional branching.755 // Reusing the registers of dead operands playing nicely with conditional branching.
756 //case.addCompareOutput(756 case.addCompareOutput(
757 // \\export fn _start() noreturn {757 \\export fn _start() noreturn {
758 // \\ assert(add(3, 4) == 791);758 \\ assert(add(3, 4) == 791);
759 // \\ assert(add(4, 3) == 79);759 \\ assert(add(4, 3) == 79);
760 // \\760 \\
761 // \\ exit();761 \\ exit();
762 // \\}762 \\}
763 // \\763 \\
764 // \\fn add(a: u32, b: u32) u32 {764 \\fn add(a: u32, b: u32) u32 {
765 // \\ const x: u32 = if (a < b) blk: {765 \\ const x: u32 = if (a < b) blk: {
766 // \\ const c = a + b; // 7766 \\ const c = a + b; // 7
767 // \\ const d = a + c; // 10767 \\ const d = a + c; // 10
768 // \\ const e = d + b; // 14768 \\ const e = d + b; // 14
769 // \\ const f = d + e; // 24769 \\ const f = d + e; // 24
770 // \\ const g = e + f; // 38770 \\ const g = e + f; // 38
771 // \\ const h = f + g; // 62771 \\ const h = f + g; // 62
772 // \\ const i = g + h; // 100772 \\ const i = g + h; // 100
773 // \\ const j = i + d; // 110773 \\ const j = i + d; // 110
774 // \\ const k = i + j; // 210774 \\ const k = i + j; // 210
775 // \\ const l = k + c; // 217775 \\ const l = k + c; // 217
776 // \\ const m = l + d; // 227776 \\ const m = l + d; // 227
777 // \\ const n = m + e; // 241777 \\ const n = m + e; // 241
778 // \\ const o = n + f; // 265778 \\ const o = n + f; // 265
779 // \\ const p = o + g; // 303779 \\ const p = o + g; // 303
780 // \\ const q = p + h; // 365780 \\ const q = p + h; // 365
781 // \\ const r = q + i; // 465781 \\ const r = q + i; // 465
782 // \\ const s = r + j; // 575782 \\ const s = r + j; // 575
783 // \\ const t = s + k; // 785783 \\ const t = s + k; // 785
784 // \\ break :blk t;784 \\ break :blk t;
785 // \\ } else blk: {785 \\ } else blk: {
786 // \\ const t = b + b + a; // 10786 \\ const t = b + b + a; // 10
787 // \\ const c = a + t; // 14787 \\ const c = a + t; // 14
788 // \\ const d = c + t; // 24788 \\ const d = c + t; // 24
789 // \\ const e = d + t; // 34789 \\ const e = d + t; // 34
790 // \\ const f = e + t; // 44790 \\ const f = e + t; // 44
791 // \\ const g = f + t; // 54791 \\ const g = f + t; // 54
792 // \\ const h = c + g; // 68792 \\ const h = c + g; // 68
793 // \\ break :blk h + b; // 71793 \\ break :blk h + b; // 71
794 // \\ };794 \\ };
795 // \\ const y = x + a; // 788, 75795 \\ const y = x + a; // 788, 75
796 // \\ const z = y + a; // 791, 79796 \\ const z = y + a; // 791, 79
797 // \\ return z;797 \\ return z;
798 // \\}798 \\}
799 // \\799 \\
800 // \\pub fn assert(ok: bool) void {800 \\pub fn assert(ok: bool) void {
801 // \\ if (!ok) unreachable; // assertion failure801 \\ if (!ok) unreachable; // assertion failure
802 // \\}802 \\}
803 // \\803 \\
804 // \\fn exit() noreturn {804 \\fn exit() noreturn {
805 // \\ asm volatile ("syscall"805 \\ asm volatile ("syscall"
806 // \\ :806 \\ :
807 // \\ : [number] "{rax}" (231),807 \\ : [number] "{rax}" (231),
808 // \\ [arg1] "{rdi}" (0)808 \\ [arg1] "{rdi}" (0)
809 // \\ : "rcx", "r11", "memory"809 \\ : "rcx", "r11", "memory"
810 // \\ );810 \\ );
811 // \\ unreachable;811 \\ unreachable;
812 // \\}812 \\}
813 //,813 ,
814 // "",814 "",
815 //);815 );
816816
817 // Character literals and multiline strings.817 // Character literals and multiline strings.
818 case.addCompareOutput(818 case.addCompareOutput(