[PATCH] Fix assertions on annot_* tokens in clang -E

Argyrios Kyrtzidis kyrtzidis at apple.com
Thu Jan 30 09:59:38 PST 2014


On Jan 30, 2014, at 9:38 AM, Ben Langmuir <blangmuir at apple.com> wrote:

> This patch fixes some assertion failures from having annot_* tokens show up during preprocessing.  In particular,  pragma clang __debug, and when #include is implicitly transformed into @import.


+// RUN: %clang_cc1 -E %s -fmodules -fmodules-cache-path=%t | FileCheck %s
+// CHECK: @import {{.*}}string; /* clang -E: implicit import
+#include <string.h>

The test should not depend on a system header, particularly depending on the system header being modular.

Try using a custom module or an isysroot specific for testing, e.g 
test/Modules//self-import-header/test.m
uses a custom isysroot.


> 
> Ben
> 
> <fix-pp-assert.patch>




More information about the cfe-commits mailing list