aboutsummaryrefslogtreecommitdiffstats
path: root/libacc/tests
diff options
context:
space:
mode:
authorJack Palevich <jackpal@google.com>2009-11-09 16:28:51 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-11-09 16:28:51 -0800
commit13edb721c0a933b943f77385c412563c26425c05 (patch)
tree7027a749d14b2b08ed236b51ff44db63768588dd /libacc/tests
parentc923980e785c533e41e403e9644368643dbac952 (diff)
parent556c60f4f27e2a3bfde6a47acf876716ea8d5795 (diff)
downloadsystem_core-13edb721c0a933b943f77385c412563c26425c05.tar.gz
system_core-13edb721c0a933b943f77385c412563c26425c05.tar.bz2
system_core-13edb721c0a933b943f77385c412563c26425c05.zip
am 556c60f4: am 51da51a2: am 02effee6: Correctly compute the type of an assignment expression.
Merge commit '556c60f4f27e2a3bfde6a47acf876716ea8d5795' * commit '556c60f4f27e2a3bfde6a47acf876716ea8d5795': Correctly compute the type of an assignment expression.
Diffstat (limited to 'libacc/tests')
-rw-r--r--libacc/tests/data/assignment.c9
-rw-r--r--libacc/tests/test.py5
2 files changed, 14 insertions, 0 deletions
diff --git a/libacc/tests/data/assignment.c b/libacc/tests/data/assignment.c
new file mode 100644
index 00000000..4fc7801d
--- /dev/null
+++ b/libacc/tests/data/assignment.c
@@ -0,0 +1,9 @@
+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;
+}
diff --git a/libacc/tests/test.py b/libacc/tests/test.py
index d93af468..c32ce9fe 100644
--- a/libacc/tests/test.py
+++ b/libacc/tests/test.py
@@ -442,6 +442,11 @@ result: 0
result: -2
""","""""")
+ def testAssignment(self):
+ self.compileCheck(["-R", "data/assignment.c"], """Executing compiled code:
+result: 7
+""","""""")
+
def testArray(self):
self.compileCheck(["-R", "data/array.c"], """Executing compiled code:
localInt: 3