diff options
author | Brad King <brad.king@kitware.com> | 2014-04-11 18:49:22 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-04-11 18:51:06 (GMT) |
commit | 2bba2e9e8900666ca92a7abb848ee8e5756462d8 (patch) | |
tree | 359d4dd98514b54ccf2b71c1fb178fc21f8d3215 /test | |
parent | 81475d7fc881a5cdaa2e2a1e61ad335a52549093 (diff) | |
download | CastXML-2bba2e9e8900666ca92a7abb848ee8e5756462d8.zip CastXML-2bba2e9e8900666ca92a7abb848ee8e5756462d8.tar.gz CastXML-2bba2e9e8900666ca92a7abb848ee8e5756462d8.tar.bz2 |
Output: Generate location attributes for builtin declarations
Report a file id "f0" named "<builtin>" for declarations that are
generated by the compiler and have no reference location in the source.
Add a test case covering the MSVC builtin "size_t" typedef.
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 1 | ||||
-rw-r--r-- | test/expect/gccxml.any.implicit-decl-ms.xml.txt | 11 | ||||
-rw-r--r-- | test/input/implicit-decl-ms.cxx | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 27b2972..22858aa 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -189,6 +189,7 @@ castxml_test_gccxml(using-directive-start) if(";${LLVM_TARGETS_TO_BUILD};" MATCHES ";X86;") set(castxml_test_gccxml_extra_arguments -target i386-pc-windows-msvc) + castxml_test_gccxml(implicit-decl-ms) castxml_test_gccxml(inline-asm-ms) unset(castxml_test_gccxml_extra_arguments) endif() diff --git a/test/expect/gccxml.any.implicit-decl-ms.xml.txt b/test/expect/gccxml.any.implicit-decl-ms.xml.txt new file mode 100644 index 0000000..d6ac862 --- /dev/null +++ b/test/expect/gccxml.any.implicit-decl-ms.xml.txt @@ -0,0 +1,11 @@ +^<\?xml version="1.0"\?> +<GCC_XML[^>]*> + <Function id="_1" name="start" returns="_2" context="_3" location="f1:1" file="f1" line="1"> + <Argument type="_2" location="f1:1" file="f1" line="1"/> + </Function> + <Typedef id="_2" name="size_t" type="_4" context="_3" location="f0:0" file="f0" line="0"/> + <FundamentalType id="_4" name="unsigned int"/> + <Namespace id="_3" name="::"/> + <File id="f0" name="<builtin>"/> + <File id="f1" name=".*/test/input/implicit-decl-ms.cxx"/> +</GCC_XML>$ diff --git a/test/input/implicit-decl-ms.cxx b/test/input/implicit-decl-ms.cxx new file mode 100644 index 0000000..47f16e8 --- /dev/null +++ b/test/input/implicit-decl-ms.cxx @@ -0,0 +1 @@ +size_t start(size_t); |