1f4a2713aSLionel Sambuc // RUN: rm -rf %t 2f4a2713aSLionel Sambuc // RUN: mkdir %t 3f4a2713aSLionel Sambuc // RUN: c-index-test -test-load-source all -comments-xml-schema=%S/../../bindings/xml/comment-xml-schema.rng -target x86_64-apple-darwin10 %s > %t/out 4f4a2713aSLionel Sambuc // RUN: FileCheck %s < %t/out 5f4a2713aSLionel Sambuc 6f4a2713aSLionel Sambuc // Ensure that XML we generate is not invalid. 7f4a2713aSLionel Sambuc // RUN: FileCheck %s -check-prefix=WRONG < %t/out 8f4a2713aSLionel Sambuc // WRONG-NOT: CommentXMLInvalid 9f4a2713aSLionel Sambuc // rdar://12378714 10f4a2713aSLionel Sambuc 11f4a2713aSLionel Sambuc /** 12f4a2713aSLionel Sambuc * \brief Aaa. 13f4a2713aSLionel Sambuc */ 14f4a2713aSLionel Sambuc int global_function(); 15f4a2713aSLionel Sambuc // CHECK: <Declaration>int global_function()</Declaration> 16f4a2713aSLionel Sambuc 17f4a2713aSLionel Sambuc /** 18f4a2713aSLionel Sambuc * \param x1 Aaa. 19f4a2713aSLionel Sambuc */ 20f4a2713aSLionel Sambuc extern void external_function(int x1); 21f4a2713aSLionel Sambuc // CHECK: <Declaration>extern void external_function(int x1)</Declaration> 22f4a2713aSLionel Sambuc 23f4a2713aSLionel Sambuc /** 24f4a2713aSLionel Sambuc * \brief global variable; 25f4a2713aSLionel Sambuc */ 26f4a2713aSLionel Sambuc int global_variable; 27f4a2713aSLionel Sambuc // CHECK: <Declaration>int global_variable</Declaration> 28f4a2713aSLionel Sambuc 29f4a2713aSLionel Sambuc /** 30f4a2713aSLionel Sambuc * \brief local variable; 31f4a2713aSLionel Sambuc */ 32f4a2713aSLionel Sambuc static int static_variable; 33f4a2713aSLionel Sambuc // CHECK: <Declaration>static int static_variable</Declaration> 34f4a2713aSLionel Sambuc 35f4a2713aSLionel Sambuc /** 36f4a2713aSLionel Sambuc * \brief external variable 37f4a2713aSLionel Sambuc */ 38f4a2713aSLionel Sambuc extern int external_variable; 39f4a2713aSLionel Sambuc // CHECK: <Declaration>extern int external_variable</Declaration> 40f4a2713aSLionel Sambuc global_function()41f4a2713aSLionel Sambucint global_function() { 42f4a2713aSLionel Sambuc /** 43f4a2713aSLionel Sambuc * \brief a local variable 44f4a2713aSLionel Sambuc */ 45f4a2713aSLionel Sambuc int local = 10; 46f4a2713aSLionel Sambuc return local; 47f4a2713aSLionel Sambuc } 48f4a2713aSLionel Sambuc // CHECK: <Declaration>int global_function()</Declaration> 49f4a2713aSLionel Sambuc // CHECK: <Declaration>int local = 10</Declaration> 50f4a2713aSLionel Sambuc 51f4a2713aSLionel Sambuc /** 52f4a2713aSLionel Sambuc * \brief initialized decl. 53f4a2713aSLionel Sambuc */ 54f4a2713aSLionel Sambuc int initialized_global = 100; 55f4a2713aSLionel Sambuc // CHECK: <Declaration>int initialized_global = 100</Declaration> 56f4a2713aSLionel Sambuc 57f4a2713aSLionel Sambuc /** 58f4a2713aSLionel Sambuc * \brief typedef example 59f4a2713aSLionel Sambuc */ 60f4a2713aSLionel Sambuc typedef int INT_T; 61f4a2713aSLionel Sambuc // CHECK: <Declaration>typedef int INT_T</Declaration> 62f4a2713aSLionel Sambuc 63f4a2713aSLionel Sambuc /** 64f4a2713aSLionel Sambuc * \brief aggregate type example 65f4a2713aSLionel Sambuc */ 66f4a2713aSLionel Sambuc struct S { 67f4a2713aSLionel Sambuc /** 68f4a2713aSLionel Sambuc * \brief iS1; 69f4a2713aSLionel Sambuc */ 70f4a2713aSLionel Sambuc int iS1; 71f4a2713aSLionel Sambuc /** 72f4a2713aSLionel Sambuc * \brief dS1; 73f4a2713aSLionel Sambuc */ 74f4a2713aSLionel Sambuc double dS1; 75f4a2713aSLionel Sambuc }; 76f4a2713aSLionel Sambuc // CHECK: <Declaration>struct S {}</Declaration> 77f4a2713aSLionel Sambuc // CHECK: <Declaration>int iS1</Declaration> 78f4a2713aSLionel Sambuc // CHECK: <Declaration>double dS1</Declaration> 79f4a2713aSLionel Sambuc 80f4a2713aSLionel Sambuc /** 81f4a2713aSLionel Sambuc * \brief enum e; 82f4a2713aSLionel Sambuc */ 83f4a2713aSLionel Sambuc enum e { 84f4a2713aSLionel Sambuc One, 85f4a2713aSLionel Sambuc /** 86f4a2713aSLionel Sambuc * \brief Two; 87f4a2713aSLionel Sambuc */ 88f4a2713aSLionel Sambuc Two, 89f4a2713aSLionel Sambuc Three 90f4a2713aSLionel Sambuc }; 91f4a2713aSLionel Sambuc // CHECK: <Declaration>enum e {}</Declaration> 92f4a2713aSLionel Sambuc // CHECK: <Declaration>Two</Declaration> 93f4a2713aSLionel Sambuc 94f4a2713aSLionel Sambuc /** 95f4a2713aSLionel Sambuc *\brief block declaration 96f4a2713aSLionel Sambuc */ 97f4a2713aSLionel Sambuc int (^Block) (int i, int j); 98f4a2713aSLionel Sambuc // CHECK: <Declaration>int (^Block)(int, int)</Declaration> 99f4a2713aSLionel Sambuc 100f4a2713aSLionel Sambuc /** 101f4a2713aSLionel Sambuc *\brief block declaration 102f4a2713aSLionel Sambuc */ 103f4a2713aSLionel Sambuc int (^Block1) (int i, int j) = ^(int i, int j) { return i + j; }; 104*0a6a1f1dSLionel Sambuc // CHECK: <Declaration>int (^Block1)(int, int) = ^(int i, int j) {\n}</Declaration> 105