[sieve] add legacy test cases for hasflag test