@@ -303,13 +303,13 @@ public void TestFindClassInNamespace()
303303 [ Test ]
304304 public void TestLineNumber ( )
305305 {
306- Assert . AreEqual ( 70 , AstContext . FindClass ( "HiddenInNamespace" ) . First ( ) . LineNumberStart ) ;
306+ Assert . AreEqual ( 72 , AstContext . FindClass ( "HiddenInNamespace" ) . First ( ) . LineNumberStart ) ;
307307 }
308308
309309 [ Test ]
310310 public void TestLineNumberOfFriend ( )
311311 {
312- Assert . AreEqual ( 93 , AstContext . FindFunction ( "operator+" ) . First ( ) . LineNumberStart ) ;
312+ Assert . AreEqual ( 95 , AstContext . FindFunction ( "operator+" ) . First ( ) . LineNumberStart ) ;
313313 }
314314
315315 static string StripWindowsNewLines ( string text )
@@ -350,7 +350,7 @@ public void TestAtomics()
350350 [ Test ]
351351 public void TestMacroLineNumber ( )
352352 {
353- Assert . AreEqual ( 103 , AstContext . FindClass ( "HasAmbiguousFunctions" ) . First ( ) . Specifiers . Last ( ) . LineNumberStart ) ;
353+ Assert . AreEqual ( 105 , AstContext . FindClass ( "HasAmbiguousFunctions" ) . First ( ) . Specifiers . Last ( ) . LineNumberStart ) ;
354354 }
355355
356356 [ Test ]
@@ -576,5 +576,30 @@ public void TestClassContext()
576576 var @classC = AstContext . FindClass ( "ClassC" ) . First ( ) ;
577577 Assert . That ( @classC . Redeclarations . Count , Is . EqualTo ( 2 ) ) ;
578578 }
579+
580+ [ Test ]
581+ public void TestRemovalOfUnusedStdTypes ( )
582+ {
583+ new IgnoreSystemDeclarationsPass { Context = Driver . Context } . VisitASTContext ( AstContext ) ;
584+ if ( Platform . IsWindows )
585+ {
586+ Assert . That ( AstContext . GetEnumWithMatchingItem ( "_ALLOC_MASK" ) . Ignore , Is . True ) ;
587+ Assert . That ( AstContext . FindClass ( "_Ctypevec" ) . First ( ) . Ignore , Is . True ) ;
588+ return ;
589+ }
590+ if ( Platform . IsLinux )
591+ {
592+ Assert . That ( AstContext . GetEnumWithMatchingItem ( "PTHREAD_RWLOCK_PREFER_READER_NP" ) . Ignore , Is . True ) ;
593+ Assert . That ( AstContext . FindClass ( "pthread_mutex_t" ) . First ( ) . Ignore , Is . True ) ;
594+ return ;
595+
596+ }
597+ if ( Platform . IsMacOS )
598+ {
599+ Assert . That ( AstContext . GetEnumWithMatchingItem ( "__n_words" ) . Ignore , Is . True ) ;
600+ Assert . That ( AstContext . FindClass ( "__darwin_fp_control" ) . First ( ) . Ignore , Is . True ) ;
601+ return ;
602+ }
603+ }
579604 }
580605}
0 commit comments