I couldn't find this in the design document but the only obvious solution is to track globals via the shared count. Since a global reference is part of all threads simultaneously, it cannot be treated as local.
If you follow this reasoning, the operations above result in local=0/shared=0 after the last assignment.