diff options
| author | Reid Kleckner <reid@kleckner.net> | 2015-08-05 18:51:13 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2015-08-05 18:51:13 +0000 |
| commit | 124955aade67bb0455a8c0dc1f01d86b265ef277 (patch) | |
| tree | 3a2e5625ea970deabec9e390df20e2566732bbe8 /clang/test | |
| parent | b2fda0d95ca1d27b1f6b1707685bd0f3fd8789d9 (diff) | |
| download | bcm5719-llvm-124955aade67bb0455a8c0dc1f01d86b265ef277.tar.gz bcm5719-llvm-124955aade67bb0455a8c0dc1f01d86b265ef277.zip | |
Add -gcodeview and -gdwarf to control which type Clang emits
Summary:
By default, 'clang' emits dwarf and 'clang-cl' emits codeview. You can
force emission of one or both by passing -gcodeview and -gdwarf to
either driver.
Reviewers: dblaikie, hans
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D11742
llvm-svn: 244097
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/CodeGen/dwarf-version.c | 9 | ||||
| -rw-r--r-- | clang/test/Driver/cl-options.c | 13 |
2 files changed, 22 insertions, 0 deletions
diff --git a/clang/test/CodeGen/dwarf-version.c b/clang/test/CodeGen/dwarf-version.c index cb95f28bc73..eadce215154 100644 --- a/clang/test/CodeGen/dwarf-version.c +++ b/clang/test/CodeGen/dwarf-version.c @@ -2,10 +2,15 @@ // RUN: %clang -target x86_64-linux-gnu -gdwarf-3 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER3 // RUN: %clang -target x86_64-linux-gnu -gdwarf-4 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4 // RUN: %clang -target x86_64-linux-gnu -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4 +// RUN: %clang -target x86_64-linux-gnu -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4 // RUN: %clang -target x86_64-apple-darwin -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER2 // RUN: %clang -target powerpc-unknown-openbsd -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER2 // RUN: %clang -target powerpc-unknown-freebsd -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER2 // RUN: %clang -target i386-pc-solaris -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER2 +// +// Test what -gcodeview and -gdwarf do on Windows. +// RUN: %clang -target i686-pc-windows-msvc -gcodeview -S -emit-llvm -o - %s | FileCheck %s --check-prefix=NODWARF --check-prefix=CODEVIEW +// RUN: %clang -target i686-pc-windows-msvc -gdwarf -gcodeview -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4 --check-prefix=CODEVIEW int main (void) { return 0; } @@ -13,3 +18,7 @@ int main (void) { // VER2: !{i32 2, !"Dwarf Version", i32 2} // VER3: !{i32 2, !"Dwarf Version", i32 3} // VER4: !{i32 2, !"Dwarf Version", i32 4} + +// NODWARF-NOT: !"Dwarf Version" +// CODEVIEW: !{i32 2, !"CodeView", i32 1} +// NODWARF-NOT: !"Dwarf Version" diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c index b259668568d..fc2206dcc93 100644 --- a/clang/test/Driver/cl-options.c +++ b/clang/test/Driver/cl-options.c @@ -360,6 +360,19 @@ // RUN: %clang_cl /Zc:threadSafeInit /c -### -- %s 2>&1 | FileCheck -check-prefix=ThreadSafeStatics %s // ThreadSafeStatics-NOT: "-fno-threadsafe-statics" +// RUN: %clang_cl /Zi /c -### -- %s 2>&1 | FileCheck -check-prefix=Zi %s +// Zi: "-gline-tables-only" +// Zi: "-gcodeview" + +// RUN: %clang_cl /Z7 /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7 %s +// Z7: "-gline-tables-only" +// Z7: "-gcodeview" + +// RUN: %clang_cl /Z7 -gdwarf /c -### -- %s 2>&1 | FileCheck -check-prefix=Z7_gdwarf %s +// Z7_gdwarf: "-gline-tables-only" +// Z7_gdwarf: "-gcodeview" +// Z7_gdwarf: "-gdwarf-4" + // RUN: %clang_cl -fmsc-version=1800 -TP -### -- %s 2>&1 | FileCheck -check-prefix=CXX11 %s // CXX11: -std=c++11 |

