@@ -322,6 +322,11 @@ class TestPreprocessor : public TestFixture {
322322 TEST_CASE (getConfigs15); // #1059
323323 TEST_CASE (getConfigs16); // #1059
324324 TEST_CASE (getConfigs17); // #1059
325+ TEST_CASE (getConfigs18); // #1059
326+ TEST_CASE (getConfigs19); // #1059
327+ TEST_CASE (getConfigs20); // #1059
328+ TEST_CASE (getConfigs21); // #1059
329+ TEST_CASE (getConfigs22); // #1059
325330 TEST_CASE (getConfigsError);
326331
327332 TEST_CASE (getConfigsD1);
@@ -2321,6 +2326,41 @@ class TestPreprocessor : public TestFixture {
23212326 ASSERT_EQUALS (" \n A=0\n " , getConfigsStr (filedata));
23222327 }
23232328
2329+ void getConfigs18 () { // #1059
2330+ const char filedata[] = " #if A == 1 && defined(B)\n "
2331+ " 1\n "
2332+ " #endif\n " ;
2333+ ASSERT_EQUALS (" \n A=1;B\n " , getConfigsStr (filedata));
2334+ }
2335+
2336+ void getConfigs19 () { // #1059
2337+ const char filedata[] = " #if A >= 1 && defined(B)\n "
2338+ " 1\n "
2339+ " #endif\n " ;
2340+ ASSERT_EQUALS (" \n A=1;B\n " , getConfigsStr (filedata));
2341+ }
2342+
2343+ void getConfigs20 () { // #1059
2344+ const char filedata[] = " #if A <= 1 && defined(B)\n "
2345+ " 1\n "
2346+ " #endif\n " ;
2347+ ASSERT_EQUALS (" \n A=1;B\n " , getConfigsStr (filedata));
2348+ }
2349+
2350+ void getConfigs21 () { // #1059
2351+ const char filedata[] = " #if A > 1 && defined(B)\n "
2352+ " 1\n "
2353+ " #endif\n " ;
2354+ ASSERT_EQUALS (" \n A=2;B\n " , getConfigsStr (filedata));
2355+ }
2356+
2357+ void getConfigs22 () { // #1059
2358+ const char filedata[] = " #if A < 1 && defined(B)\n "
2359+ " 1\n "
2360+ " #endif\n " ;
2361+ ASSERT_EQUALS (" \n A=0;B\n " , getConfigsStr (filedata));
2362+ }
2363+
23242364 void getConfigsError () {
23252365 const char filedata1[] = " #ifndef X\n "
23262366 " #error \" !X\"\n "
0 commit comments