With modules, we can end up loading a new module after we've seen an
arbitrary amount of code. This forces us to stage the AST writer more
strictly, ensuring that we don't assign a declaration ID to a
declaration until after we're certain that no more modules will get
loaded.

llvm-svn: 139974
diff --git a/clang/test/Modules/objc-categories.m b/clang/test/Modules/objc-categories.m
index 6022187..87aaa5c 100644
--- a/clang/test/Modules/objc-categories.m
+++ b/clang/test/Modules/objc-categories.m
@@ -54,12 +54,13 @@
 #elif defined(MODULE_BOTTOM)
 
 __import_module__ diamond_left;
-__import_module__ diamond_right;
 
 @interface Foo(Bottom)
 -(void)bottom;
 @end
 
+__import_module__ diamond_right;
+
 @interface LeftFoo(Bottom)
 -(void)bottom;
 @end