/* civlValueUndefined : This example lists several cases of misusage of $scope, $proc and pointer types. It is used for code coverage, so the program may not meaningful. */ #include #include $scope scope; double * ptr; int dummy(int x); void getInvalidScope() { scope = $here; ptr = (double*)malloc(sizeof(double)); free(ptr); } int main() { $scope root = $root; $proc proc0, proc1; int a = 0; proc0 = $spawn getInvalidScope(); $wait(proc0); proc1 = proc0; //so far, scope, proc0 and proc1 are all undefined; ptr is to a //memory space which belongs to an undefined scope. //And, the function dummy() is "undefined" too: it only has a declaration. $choose{ $when($true) {a = scope == root;} $when($true) {a = proc0 == proc1;} $when($true) {a = ptr == (void*)0;} $when($true) {a = dummy(a);}; } return 0; }