Add a test to find a bug of LOGICAL_NOT.

Redmine: refs #2381.