Loading libacc/acc.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -1666,6 +1666,7 @@ class Compiler : public ErrorSink { pDestType->tag); break; } setR0Type(pDestType); } virtual void loadR0FromR0() { Loading Loading @@ -2836,6 +2837,7 @@ class Compiler : public ErrorSink { pTargetType->tag); break; } setR0Type(pTargetType); } virtual void loadR0FromR0() { Loading libacc/tests/data/assignment.c 0 → 100644 +9 −0 Original line number Diff line number Diff line int main() { int a = 0; int b = 1; a = b = 2; // Test that "b = 2" generates an rvalue. if (a = 7) { // Test that a = 7 generates an rvalue. b = 3; } return a; } libacc/tests/test.py +5 −0 Original line number Diff line number Diff line Loading @@ -424,6 +424,11 @@ result: 0 def testShort(self): self.compileCheck(["-R", "data/short.c"], """Executing compiled code: result: -2 ""","""""") def testAssignment(self): self.compileCheck(["-R", "data/assignment.c"], """Executing compiled code: result: 7 ""","""""") def testArray(self): Loading Loading
libacc/acc.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -1666,6 +1666,7 @@ class Compiler : public ErrorSink { pDestType->tag); break; } setR0Type(pDestType); } virtual void loadR0FromR0() { Loading Loading @@ -2836,6 +2837,7 @@ class Compiler : public ErrorSink { pTargetType->tag); break; } setR0Type(pTargetType); } virtual void loadR0FromR0() { Loading
libacc/tests/data/assignment.c 0 → 100644 +9 −0 Original line number Diff line number Diff line int main() { int a = 0; int b = 1; a = b = 2; // Test that "b = 2" generates an rvalue. if (a = 7) { // Test that a = 7 generates an rvalue. b = 3; } return a; }
libacc/tests/test.py +5 −0 Original line number Diff line number Diff line Loading @@ -424,6 +424,11 @@ result: 0 def testShort(self): self.compileCheck(["-R", "data/short.c"], """Executing compiled code: result: -2 ""","""""") def testAssignment(self): self.compileCheck(["-R", "data/assignment.c"], """Executing compiled code: result: 7 ""","""""") def testArray(self): Loading