diff options
author | Devang Patel <dpatel@apple.com> | 2009-04-23 18:09:16 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-04-23 18:09:16 +0000 |
commit | a6acb390e70453fd129cdaa19bdf8b0e206081f5 (patch) | |
tree | e1d52250bf2e2be4d890b81cba27d750a80e3010 /clang/test/CodeGen | |
parent | 466af3eb461b017b731df1cf743a8d7fd9a168aa (diff) | |
download | bcm5719-llvm-a6acb390e70453fd129cdaa19bdf8b0e206081f5.tar.gz bcm5719-llvm-a6acb390e70453fd129cdaa19bdf8b0e206081f5.zip |
Handle corner case where clang-cc is invoked directly to compile preprocessed source file without -main-file-name. In this case, CDDebugInfo is not able identify correct main source file becase SM.isFromMainFile() returns true for locations from header files as well as locations from main source file.
This patch takes conservative approach by not emitting more then one compile unit with isMain bit set.
llvm-svn: 69902
Diffstat (limited to 'clang/test/CodeGen')
-rw-r--r-- | clang/test/CodeGen/2009-04-23-dbg.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/CodeGen/2009-04-23-dbg.c b/clang/test/CodeGen/2009-04-23-dbg.c new file mode 100644 index 00000000000..4be6dab7ea2 --- /dev/null +++ b/clang/test/CodeGen/2009-04-23-dbg.c @@ -0,0 +1,20 @@ +// RUN: clang-cc -g -o %t %s -emit-llvm-bc && llc %t -f -o %t.s +# 1 "a.c" +# 1 "a.c" 1 +# 1 "<built-in>" 1 +# 103 "<built-in>" +# 103 "<command line>" 1 + +# 1 "/private/tmp/a.h" 1 +int bar; +# 105 "<command line>" 2 +# 105 "<built-in>" 2 +# 1 "a.c" 2 +# 1 "/private/tmp/a.h" 1 +int bar; +# 2 "a.c" 2 + +int main() { + bar = 0; + return 0; +} |