android_system_core/libacc/tests/data/assignment.c
Jack Palevich 02effee6a9 Correctly compute the type of an assignment expression.
This change enables following types of statements to work correctly:

    a = b = 3;
    if ((a = getchar()) < 0) { ... }

This fixes 2232082 acc: assignment in comparison segfaults
2009-11-09 12:52:45 +08:00

9 lines
194 B
C

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;
}