diff options
author | David Callahan <dcallahan@fb.com> | 2017-01-25 01:55:28 +0000 |
---|---|---|
committer | David Callahan <dcallahan@fb.com> | 2017-01-25 01:55:28 +0000 |
commit | ad4e2ce2f9cf7b19cc4efc1a64982b5ae06d2f4f (patch) | |
tree | 424f42b0a919af79c5494a0c52891a4fab87e248 /test/Frontend | |
parent | f6a1ff2d6495325d28947cc57805dd2507d67083 (diff) |
Use filename in linemarker when compiling preprocessed source
Summary:
Clang appears to always use name as specified on the command
line, whereas gcc uses the name as specified in the linemarker at the
first line when compiling a preprocessed source. This results mismatch
between two compilers in FILE symbol table entry. This patch makes clang
to resemble gcc's behavior in finding the original source file name and
use it as an input file name.
Even with this patch, values of FILE symbol table entry may still be
different because clang uses dirname+basename for the entry whlie gcc
uses basename only. I'll write a patch for that once this patch is
committed.
Reviewers: dblaikie, inglorion
Reviewed By: inglorion
Subscribers: inglorion, aprantl, bruno
Differential Revision: https://reviews.llvm.org/D28796
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293004 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Frontend')
-rw-r--r-- | test/Frontend/preprocessed-input.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/Frontend/preprocessed-input.c b/test/Frontend/preprocessed-input.c new file mode 100644 index 0000000000..f9c449a846 --- /dev/null +++ b/test/Frontend/preprocessed-input.c @@ -0,0 +1,4 @@ +// RUN: %clang -E -o %t.i %s +// RUN: %clang -Xclang -triple -Xclang i686-linux-gnu -c -o %t.o %t.i +// RUN: llvm-objdump -t %t.o | FileCheck %s +// CHECK: l{{ +}}df{{ +}}*ABS*{{ +}}{{0+}}{{.+}}preprocessed-input.c{{$}} |