diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-03-11 00:00:51 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-03-11 00:00:51 +0000 |
commit | 9ab4ccecb3981c466951f4ff3f2a788eb1b1a6db (patch) | |
tree | dcfbbd543c68e6407a30e862582fb4421bac1c1d /clang/test | |
parent | b93fb82b3f8efa33ca1dbb4b47876369cc5297b8 (diff) | |
download | bcm5719-llvm-9ab4ccecb3981c466951f4ff3f2a788eb1b1a6db.tar.gz bcm5719-llvm-9ab4ccecb3981c466951f4ff3f2a788eb1b1a6db.zip |
[modules] Fix iterator invalidation issue with names being added to a module
while we're writing out the identifier table.
llvm-svn: 231890
Diffstat (limited to 'clang/test')
4 files changed, 25 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/invalidate-identifiers/a.h b/clang/test/Modules/Inputs/invalidate-identifiers/a.h new file mode 100644 index 00000000000..16fe9edcf4d --- /dev/null +++ b/clang/test/Modules/Inputs/invalidate-identifiers/a.h @@ -0,0 +1,17 @@ +// Ensure that loading 'i' introduces enough identifiers to cause the +// identifier table to be reallocated. +#define TYPEDEFS(x) typedef x##0 x; typedef x##1 x; +#define DEPTH_0(x) DEPTH_1(x##0) DEPTH_1(x##1) TYPEDEFS(x) +#define DEPTH_1(x) DEPTH_2(x##0) DEPTH_2(x##1) TYPEDEFS(x) +#define DEPTH_2(x) DEPTH_3(x##0) DEPTH_3(x##1) TYPEDEFS(x) +#define DEPTH_3(x) DEPTH_4(x##0) DEPTH_4(x##1) TYPEDEFS(x) +#define DEPTH_4(x) DEPTH_5(x##0) DEPTH_5(x##1) TYPEDEFS(x) +#define DEPTH_5(x) DEPTH_6(x##0) DEPTH_6(x##1) TYPEDEFS(x) +#define DEPTH_6(x) DEPTH_7(x##0) DEPTH_7(x##1) TYPEDEFS(x) +#define DEPTH_7(x) DEPTH_8(x##0) DEPTH_8(x##1) TYPEDEFS(x) +#define DEPTH_8(x) DEPTH_9(x##0) DEPTH_9(x##1) TYPEDEFS(x) +#define DEPTH_9(x) DEPTH_A(x##0) DEPTH_A(x##1) TYPEDEFS(x) +#define DEPTH_A(x) DEPTH_B(x##0) DEPTH_B(x##1) TYPEDEFS(x) +#define DEPTH_B(x) typedef int x; +DEPTH_0(i) +extern i v; diff --git a/clang/test/Modules/Inputs/invalidate-identifiers/b.h b/clang/test/Modules/Inputs/invalidate-identifiers/b.h new file mode 100644 index 00000000000..2af246dc774 --- /dev/null +++ b/clang/test/Modules/Inputs/invalidate-identifiers/b.h @@ -0,0 +1,2 @@ +extern int v; +#include "a.h" diff --git a/clang/test/Modules/Inputs/invalidate-identifiers/module.modulemap b/clang/test/Modules/Inputs/invalidate-identifiers/module.modulemap new file mode 100644 index 00000000000..a36568207b6 --- /dev/null +++ b/clang/test/Modules/Inputs/invalidate-identifiers/module.modulemap @@ -0,0 +1,2 @@ +module a { header "a.h" } +module b { header "b.h" } diff --git a/clang/test/Modules/invalidate-identifiers.c b/clang/test/Modules/invalidate-identifiers.c new file mode 100644 index 00000000000..de3aa10db46 --- /dev/null +++ b/clang/test/Modules/invalidate-identifiers.c @@ -0,0 +1,4 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I%S/Inputs/invalidate-identifiers -emit-llvm-only %s + +#include "b.h" |