diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-05-11 21:39:18 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-05-11 21:39:18 +0000 |
commit | df8755884e039d3f313ee0fea42b955257b5e240 (patch) | |
tree | 26513c4ed7ca970b3b266d35056c2a03d92deb69 /test/PCH/format-strings.c | |
parent | 8aeb1471ef62a4befba00721925a3717914f21d8 (diff) |
The Lexer constructor expects a source location at the start of the
file buffer, not at the start of lexing.
Fixes assertion hit in format diagnostics. rdar://11418366
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156647 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/PCH/format-strings.c')
-rw-r--r-- | test/PCH/format-strings.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/PCH/format-strings.c b/test/PCH/format-strings.c new file mode 100644 index 0000000000..7198c4d3a2 --- /dev/null +++ b/test/PCH/format-strings.c @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -D FOOBAR="\"\"" %s -emit-pch -o %t.pch +// RUN: %clang_cc1 -D FOOBAR="\"\"" %s -include-pch %t.pch + +// rdar://11418366 + +#ifndef HEADER +#define HEADER + +extern int printf(const char *restrict, ...); +#define LOG printf(FOOBAR "%f", __LINE__) + +#else + +void foo() { + LOG; +} + +#endif |