r205149 - Force a header file input to the headermap test to have different

Chandler Carruth chandlerc at gmail.com
Sun Mar 30 07:04:33 PDT 2014


Author: chandlerc
Date: Sun Mar 30 09:04:32 2014
New Revision: 205149

URL: http://llvm.org/viewvc/llvm-project?rev=205149&view=rev
Log:
Force a header file input to the headermap test to have different
contents than the header file by the same name under the system header
search root. Surprisingly, this is required to get the test to pass on
some systems.

So, it turns out that there exist filesystems in the world which unique
the inode of all files based on their contents. This results in two
files with the same contents at different paths suddenly having the same
inode. This doesn't actually cause any problems in practice as the
contents are the same, and the path used to access the files are the
same. However, it can cause tests like this one to be more brittle
because the file manager ends up de-duplicating the file entries by
inode. We don't have any other really easy ways to observe the behavior
shift because the whole point is that the #include written in the source
code doesn't contain the information -- instead it is contained in the
header map.

If folks have other solutions they would prefer, I'm more than happy to
work on them, but this seems a reasonable way to ensure that the test in
question exercises the code it wants to exercise.

Modified:
    cfe/trunk/test/Preprocessor/Inputs/headermap-rel2/Product/someheader.h

Modified: cfe/trunk/test/Preprocessor/Inputs/headermap-rel2/Product/someheader.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/Inputs/headermap-rel2/Product/someheader.h?rev=205149&r1=205148&r2=205149&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/Inputs/headermap-rel2/Product/someheader.h (original)
+++ cfe/trunk/test/Preprocessor/Inputs/headermap-rel2/Product/someheader.h Sun Mar 30 09:04:32 2014
@@ -1 +1 @@
-#define A 1
+#define A 2





More information about the cfe-commits mailing list