Changeset View
Changeset View
Standalone View
Standalone View
clang/test/Driver/debug-options.c
// Check to make sure clang is somewhat picky about -g options. | // Check to make sure clang is somewhat picky about -g options. | ||||
// rdar://10383444 | // rdar://10383444 | ||||
// Linux. | // Linux. | ||||
// RUN: %clang -### -c -g %s -target x86_64-linux-gnu 2>&1 \ | // RUN: %clang_bin -### -c -g %s -target x86_64-linux-gnu 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s | // RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s | ||||
// RUN: %clang -### -c -g2 %s -target x86_64-linux-gnu 2>&1 \ | // RUN: %clang_bin -### -c -g2 %s -target x86_64-linux-gnu 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s | // RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s | ||||
// RUN: %clang -### -c -g3 %s -target x86_64-linux-gnu 2>&1 \ | // RUN: %clang_bin -### -c -g3 %s -target x86_64-linux-gnu 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s | // RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s | ||||
// RUN: %clang -### -c -ggdb %s -target x86_64-linux-gnu 2>&1 \ | // RUN: %clang_bin -### -c -ggdb %s -target x86_64-linux-gnu 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s | // RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s | ||||
// RUN: %clang -### -c -ggdb1 %s -target x86_64-linux-gnu 2>&1 \ | // RUN: %clang_bin -### -c -ggdb1 %s -target x86_64-linux-gnu 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GLTO_ONLY -check-prefix=G_GDB %s | // RUN: | FileCheck -check-prefix=GLTO_ONLY -check-prefix=G_GDB %s | ||||
// RUN: %clang -### -c -ggdb3 %s -target x86_64-linux-gnu 2>&1 \ | // RUN: %clang_bin -### -c -ggdb3 %s -target x86_64-linux-gnu 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s | // RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s | ||||
// RUN: %clang -### -c -glldb %s -target x86_64-linux-gnu 2>&1 \ | // RUN: %clang_bin -### -c -glldb %s -target x86_64-linux-gnu 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_STANDALONE -check-prefix=G_LLDB %s | // RUN: | FileCheck -check-prefix=G_STANDALONE -check-prefix=G_LLDB %s | ||||
// RUN: %clang -### -c -gsce %s -target x86_64-linux-gnu 2>&1 \ | // RUN: %clang_bin -### -c -gsce %s -target x86_64-linux-gnu 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_SCE %s | // RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_SCE %s | ||||
// Android. | // Android. | ||||
// Android should always generate DWARF4. | // Android should always generate DWARF4. | ||||
// RUN: %clang -### -c -g %s -target arm-linux-androideabi 2>&1 \ | // RUN: %clang_bin -### -c -g %s -target arm-linux-androideabi 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_DWARF4 %s | // RUN: | FileCheck -check-prefix=G_LIMITED -check-prefix=G_DWARF4 %s | ||||
// Darwin. | // Darwin. | ||||
// RUN: %clang -### -c -g %s -target x86_64-apple-darwin14 2>&1 \ | // RUN: %clang_bin -### -c -g %s -target x86_64-apple-darwin14 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_STANDALONE \ | // RUN: | FileCheck -check-prefix=G_STANDALONE \ | ||||
// RUN: -check-prefix=G_DWARF2 \ | // RUN: -check-prefix=G_DWARF2 \ | ||||
// RUN: -check-prefix=G_LLDB %s | // RUN: -check-prefix=G_LLDB %s | ||||
// RUN: %clang -### -c -g %s -target x86_64-apple-darwin16 2>&1 \ | // RUN: %clang_bin -### -c -g %s -target x86_64-apple-darwin16 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_STANDALONE \ | // RUN: | FileCheck -check-prefix=G_STANDALONE \ | ||||
// RUN: -check-prefix=G_DWARF4 \ | // RUN: -check-prefix=G_DWARF4 \ | ||||
// RUN: -check-prefix=G_LLDB %s | // RUN: -check-prefix=G_LLDB %s | ||||
// RUN: %clang -### -c -g2 %s -target x86_64-apple-darwin16 2>&1 \ | // RUN: %clang_bin -### -c -g2 %s -target x86_64-apple-darwin16 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_STANDALONE \ | // RUN: | FileCheck -check-prefix=G_STANDALONE \ | ||||
// RUN: -check-prefix=G_DWARF4 %s | // RUN: -check-prefix=G_DWARF4 %s | ||||
// RUN: %clang -### -c -g3 %s -target x86_64-apple-darwin16 2>&1 \ | // RUN: %clang_bin -### -c -g3 %s -target x86_64-apple-darwin16 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_STANDALONE \ | // RUN: | FileCheck -check-prefix=G_STANDALONE \ | ||||
// RUN: -check-prefix=G_DWARF4 %s | // RUN: -check-prefix=G_DWARF4 %s | ||||
// RUN: %clang -### -c -ggdb %s -target x86_64-apple-darwin16 2>&1 \ | // RUN: %clang_bin -### -c -ggdb %s -target x86_64-apple-darwin16 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_STANDALONE \ | // RUN: | FileCheck -check-prefix=G_STANDALONE \ | ||||
// RUN: -check-prefix=G_DWARF4 \ | // RUN: -check-prefix=G_DWARF4 \ | ||||
// RUN: -check-prefix=G_GDB %s | // RUN: -check-prefix=G_GDB %s | ||||
// RUN: %clang -### -c -ggdb1 %s -target x86_64-apple-darwin16 2>&1 \ | // RUN: %clang_bin -### -c -ggdb1 %s -target x86_64-apple-darwin16 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s | // RUN: | FileCheck -check-prefix=GLTO_ONLY %s | ||||
// RUN: %clang -### -c -ggdb3 %s -target x86_64-apple-darwin16 2>&1 \ | // RUN: %clang_bin -### -c -ggdb3 %s -target x86_64-apple-darwin16 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_STANDALONE \ | // RUN: | FileCheck -check-prefix=G_STANDALONE \ | ||||
// RUN: -check-prefix=G_DWARF4 %s | // RUN: -check-prefix=G_DWARF4 %s | ||||
// RUN: %clang -### -c -g %s -target x86_64-apple-macosx10.11 2>&1 \ | // RUN: %clang_bin -### -c -g %s -target x86_64-apple-macosx10.11 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_STANDALONE \ | // RUN: | FileCheck -check-prefix=G_STANDALONE \ | ||||
// RUN: -check-prefix=G_DWARF4 %s | // RUN: -check-prefix=G_DWARF4 %s | ||||
// RUN: %clang -### -c -g %s -target x86_64-apple-macosx10.10 2>&1 \ | // RUN: %clang_bin -### -c -g %s -target x86_64-apple-macosx10.10 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s | // RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s | ||||
// RUN: %clang -### -c -g %s -target armv7-apple-ios9.0 2>&1 \ | // RUN: %clang_bin -### -c -g %s -target armv7-apple-ios9.0 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_STANDALONE \ | // RUN: | FileCheck -check-prefix=G_STANDALONE \ | ||||
// RUN: -check-prefix=G_DWARF4 %s | // RUN: -check-prefix=G_DWARF4 %s | ||||
// RUN: %clang -### -c -g %s -target armv7-apple-ios8.0 2>&1 \ | // RUN: %clang_bin -### -c -g %s -target armv7-apple-ios8.0 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s | // RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s | ||||
// RUN: %clang -### -c -g %s -target armv7k-apple-watchos 2>&1 \ | // RUN: %clang_bin -### -c -g %s -target armv7k-apple-watchos 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_STANDALONE \ | // RUN: | FileCheck -check-prefix=G_STANDALONE \ | ||||
// RUN: -check-prefix=G_DWARF4 %s | // RUN: -check-prefix=G_DWARF4 %s | ||||
// RUN: %clang -### -c -g %s -target arm64-apple-tvos9.0 2>&1 \ | // RUN: %clang_bin -### -c -g %s -target arm64-apple-tvos9.0 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_STANDALONE \ | // RUN: | FileCheck -check-prefix=G_STANDALONE \ | ||||
// RUN: -check-prefix=G_DWARF4 %s | // RUN: -check-prefix=G_DWARF4 %s | ||||
// RUN: %clang -### -c -fsave-optimization-record %s \ | // RUN: %clang_bin -### -c -fsave-optimization-record %s \ | ||||
// RUN: -target x86_64-apple-darwin 2>&1 \ | // RUN: -target x86_64-apple-darwin 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s | // RUN: | FileCheck -check-prefix=GLTO_ONLY %s | ||||
// RUN: %clang -### -c -g -fsave-optimization-record %s \ | // RUN: %clang_bin -### -c -g -fsave-optimization-record %s \ | ||||
// RUN: -target x86_64-apple-darwin 2>&1 \ | // RUN: -target x86_64-apple-darwin 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_STANDALONE %s | // RUN: | FileCheck -check-prefix=G_STANDALONE %s | ||||
// FreeBSD. | // FreeBSD. | ||||
// RUN: %clang -### -c -g %s -target x86_64-pc-freebsd11.0 2>&1 \ | // RUN: %clang_bin -### -c -g %s -target x86_64-pc-freebsd11.0 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_GDB \ | // RUN: | FileCheck -check-prefix=G_GDB \ | ||||
// RUN: -check-prefix=G_DWARF2 %s | // RUN: -check-prefix=G_DWARF2 %s | ||||
// RUN: %clang -### -c -g %s -target x86_64-pc-freebsd12.0 2>&1 \ | // RUN: %clang_bin -### -c -g %s -target x86_64-pc-freebsd12.0 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_GDB \ | // RUN: | FileCheck -check-prefix=G_GDB \ | ||||
// RUN: -check-prefix=G_DWARF4 %s | // RUN: -check-prefix=G_DWARF4 %s | ||||
// Windows. | // Windows. | ||||
// RUN: %clang -### -c -g %s -target x86_64-w64-windows-gnu 2>&1 \ | // RUN: %clang_bin -### -c -g %s -target x86_64-w64-windows-gnu 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_GDB %s | // RUN: | FileCheck -check-prefix=G_GDB %s | ||||
// RUN: %clang -### -c -g %s -target x86_64-windows-msvc 2>&1 \ | // RUN: %clang_bin -### -c -g %s -target x86_64-windows-msvc 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_NOTUNING %s | // RUN: | FileCheck -check-prefix=G_NOTUNING %s | ||||
// RUN: %clang_cl -### -c -Z7 -target x86_64-windows-msvc -- %s 2>&1 \ | // RUN: %clang_cl -### -c -Z7 -target x86_64-windows-msvc -- %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_NOTUNING %s | // RUN: | FileCheck -check-prefix=G_NOTUNING %s | ||||
// On the PS4, -g defaults to -gno-column-info, and we always generate the | // On the PS4, -g defaults to -gno-column-info, and we always generate the | ||||
// arange section. | // arange section. | ||||
// RUN: %clang -### -c %s -target x86_64-scei-ps4 2>&1 \ | // RUN: %clang_bin -### -c %s -target x86_64-scei-ps4 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=NOG_PS4 %s | // RUN: | FileCheck -check-prefix=NOG_PS4 %s | ||||
// RUN: %clang -### -c %s -g -target x86_64-scei-ps4 2>&1 \ | // RUN: %clang_bin -### -c %s -g -target x86_64-scei-ps4 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_PS4 %s | // RUN: | FileCheck -check-prefix=G_PS4 %s | ||||
// RUN: %clang -### -c %s -g -target x86_64-scei-ps4 2>&1 \ | // RUN: %clang_bin -### -c %s -g -target x86_64-scei-ps4 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_SCE %s | // RUN: | FileCheck -check-prefix=G_SCE %s | ||||
// RUN: %clang -### -c %s -g -target x86_64-scei-ps4 2>&1 \ | // RUN: %clang_bin -### -c %s -g -target x86_64-scei-ps4 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=NOCI %s | // RUN: | FileCheck -check-prefix=NOCI %s | ||||
// RUN: %clang -### -c %s -g -gcolumn-info -target x86_64-scei-ps4 2>&1 \ | // RUN: %clang_bin -### -c %s -g -gcolumn-info -target x86_64-scei-ps4 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=CI %s | // RUN: | FileCheck -check-prefix=CI %s | ||||
// RUN: %clang -### -c %s -gsce -target x86_64-unknown-linux 2>&1 \ | // RUN: %clang_bin -### -c %s -gsce -target x86_64-unknown-linux 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=NOCI %s | // RUN: | FileCheck -check-prefix=NOCI %s | ||||
// RUN: %clang -### -c -gdwarf-2 %s 2>&1 \ | // RUN: %clang_bin -### -c -gdwarf-2 %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s | // RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s | ||||
// | // | ||||
// RUN: not %clang -### -c -gfoo %s 2>&1 | FileCheck -check-prefix=G_ERR %s | // RUN: not %clang -### -c -gfoo %s 2>&1 | FileCheck -check-prefix=G_ERR %s | ||||
// RUN: %clang -### -c -g -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s | // RUN: %clang_bin -### -c -g -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s | ||||
// RUN: %clang -### -c -ggdb0 %s 2>&1 | FileCheck -check-prefix=G_NO %s | // RUN: %clang_bin -### -c -ggdb0 %s 2>&1 | FileCheck -check-prefix=G_NO %s | ||||
// RUN: %clang -### -c -glldb -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s | // RUN: %clang_bin -### -c -glldb -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s | ||||
// RUN: %clang -### -c -glldb -g1 %s 2>&1 \ | // RUN: %clang_bin -### -c -glldb -g1 %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GLTO_ONLY -check-prefix=G_LLDB %s | // RUN: | FileCheck -check-prefix=GLTO_ONLY -check-prefix=G_LLDB %s | ||||
// | // | ||||
// PS4 defaults to sce; -ggdb0 changes tuning but turns off debug info, | // PS4 defaults to sce; -ggdb0 changes tuning but turns off debug info, | ||||
// then -g turns it back on without affecting tuning. | // then -g turns it back on without affecting tuning. | ||||
// RUN: %clang -### -c -ggdb0 -g -target x86_64-scei-ps4 %s 2>&1 \ | // RUN: %clang_bin -### -c -ggdb0 -g -target x86_64-scei-ps4 %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G -check-prefix=G_GDB %s | // RUN: | FileCheck -check-prefix=G -check-prefix=G_GDB %s | ||||
// | // | ||||
// RUN: %clang -### -c -g1 %s 2>&1 \ | // RUN: %clang_bin -### -c -g1 %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s | // RUN: | FileCheck -check-prefix=GLTO_ONLY %s | ||||
// RUN: %clang -### -c -gmlt %s 2>&1 \ | // RUN: %clang_bin -### -c -gmlt %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s | // RUN: | FileCheck -check-prefix=GLTO_ONLY %s | ||||
// RUN: %clang -### -c -gline-tables-only %s 2>&1 \ | // RUN: %clang_bin -### -c -gline-tables-only %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s | // RUN: | FileCheck -check-prefix=GLTO_ONLY %s | ||||
// RUN: %clang -### -c -gline-tables-only %s -target x86_64-apple-darwin 2>&1 \ | // RUN: %clang_bin -### -c -gline-tables-only %s -target x86_64-apple-darwin 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s | // RUN: | FileCheck -check-prefix=GLTO_ONLY %s | ||||
// RUN: %clang -### -c -gline-tables-only %s -target i686-pc-openbsd 2>&1 \ | // RUN: %clang_bin -### -c -gline-tables-only %s -target i686-pc-openbsd 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GLTO_ONLY_DWARF2 %s | // RUN: | FileCheck -check-prefix=GLTO_ONLY_DWARF2 %s | ||||
// RUN: %clang -### -c -gline-tables-only %s -target x86_64-pc-freebsd10.0 2>&1 \ | // RUN: %clang_bin -### -c -gline-tables-only %s -target x86_64-pc-freebsd10.0 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GLTO_ONLY_DWARF2 %s | // RUN: | FileCheck -check-prefix=GLTO_ONLY_DWARF2 %s | ||||
// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-linux-gnu 2>&1 \ | // RUN: %clang_bin -### -c -gline-tables-only -g %s -target x86_64-linux-gnu 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_ONLY %s | // RUN: | FileCheck -check-prefix=G_ONLY %s | ||||
// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-apple-darwin16 2>&1 \ | // RUN: %clang_bin -### -c -gline-tables-only -g %s -target x86_64-apple-darwin16 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_STANDALONE -check-prefix=G_DWARF4 %s | // RUN: | FileCheck -check-prefix=G_STANDALONE -check-prefix=G_DWARF4 %s | ||||
// RUN: %clang -### -c -gline-tables-only -g %s -target i686-pc-openbsd 2>&1 \ | // RUN: %clang_bin -### -c -gline-tables-only -g %s -target i686-pc-openbsd 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s | // RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s | ||||
// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-pc-freebsd10.0 2>&1 \ | // RUN: %clang_bin -### -c -gline-tables-only -g %s -target x86_64-pc-freebsd10.0 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s | // RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s | ||||
// RUN: %clang -### -c -gline-tables-only -g %s -target i386-pc-solaris 2>&1 \ | // RUN: %clang_bin -### -c -gline-tables-only -g %s -target i386-pc-solaris 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s | // RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s | ||||
// RUN: %clang -### -c -gline-tables-only -g0 %s 2>&1 \ | // RUN: %clang_bin -### -c -gline-tables-only -g0 %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GLTO_NO %s | // RUN: | FileCheck -check-prefix=GLTO_NO %s | ||||
// | // | ||||
// RUN: %clang -### -c -gline-directives-only %s -target x86_64-apple-darwin 2>&1 \ | // RUN: %clang_bin -### -c -gline-directives-only %s -target x86_64-apple-darwin 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GLIO_ONLY %s | // RUN: | FileCheck -check-prefix=GLIO_ONLY %s | ||||
// RUN: %clang -### -c -gline-directives-only %s -target i686-pc-openbsd 2>&1 \ | // RUN: %clang_bin -### -c -gline-directives-only %s -target i686-pc-openbsd 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GLIO_ONLY_DWARF2 %s | // RUN: | FileCheck -check-prefix=GLIO_ONLY_DWARF2 %s | ||||
// RUN: %clang -### -c -gline-directives-only %s -target x86_64-pc-freebsd10.0 2>&1 \ | // RUN: %clang_bin -### -c -gline-directives-only %s -target x86_64-pc-freebsd10.0 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GLIO_ONLY_DWARF2 %s | // RUN: | FileCheck -check-prefix=GLIO_ONLY_DWARF2 %s | ||||
// RUN: %clang -### -c -gline-directives-only -g %s -target x86_64-linux-gnu 2>&1 \ | // RUN: %clang_bin -### -c -gline-directives-only -g %s -target x86_64-linux-gnu 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_ONLY %s | // RUN: | FileCheck -check-prefix=G_ONLY %s | ||||
// RUN: %clang -### -c -gline-directives-only -g %s -target x86_64-apple-darwin16 2>&1 \ | // RUN: %clang_bin -### -c -gline-directives-only -g %s -target x86_64-apple-darwin16 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_STANDALONE -check-prefix=G_DWARF4 %s | // RUN: | FileCheck -check-prefix=G_STANDALONE -check-prefix=G_DWARF4 %s | ||||
// RUN: %clang -### -c -gline-directives-only -g %s -target i686-pc-openbsd 2>&1 \ | // RUN: %clang_bin -### -c -gline-directives-only -g %s -target i686-pc-openbsd 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s | // RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s | ||||
// RUN: %clang -### -c -gline-directives-only -g %s -target x86_64-pc-freebsd10.0 2>&1 \ | // RUN: %clang_bin -### -c -gline-directives-only -g %s -target x86_64-pc-freebsd10.0 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s | // RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s | ||||
// RUN: %clang -### -c -gline-directives-only -g %s -target i386-pc-solaris 2>&1 \ | // RUN: %clang_bin -### -c -gline-directives-only -g %s -target i386-pc-solaris 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s | // RUN: | FileCheck -check-prefix=G_ONLY_DWARF2 %s | ||||
// RUN: %clang -### -c -gline-directives-only -g0 %s 2>&1 \ | // RUN: %clang_bin -### -c -gline-directives-only -g0 %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GLIO_NO %s | // RUN: | FileCheck -check-prefix=GLIO_NO %s | ||||
// | // | ||||
// RUN: %clang -### -c -grecord-gcc-switches %s 2>&1 \ | // RUN: %clang_bin -### -c -grecord-gcc-switches %s 2>&1 \ | ||||
// | FileCheck -check-prefix=GRECORD %s | // | FileCheck -check-prefix=GRECORD %s | ||||
// RUN: %clang -### -c -gno-record-gcc-switches %s 2>&1 \ | // RUN: %clang_bin -### -c -gno-record-gcc-switches %s 2>&1 \ | ||||
// | FileCheck -check-prefix=GNO_RECORD %s | // | FileCheck -check-prefix=GNO_RECORD %s | ||||
// RUN: %clang -### -c -grecord-gcc-switches -gno-record-gcc-switches %s 2>&1 \ | // RUN: %clang_bin -### -c -grecord-gcc-switches -gno-record-gcc-switches %s 2>&1 \ | ||||
// | FileCheck -check-prefix=GNO_RECORD %s/ | // | FileCheck -check-prefix=GNO_RECORD %s/ | ||||
// RUN: %clang -### -c -grecord-gcc-switches -o - %s 2>&1 \ | // RUN: %clang_bin -### -c -grecord-gcc-switches -o - %s 2>&1 \ | ||||
// | FileCheck -check-prefix=GRECORD_O %s | // | FileCheck -check-prefix=GRECORD_O %s | ||||
// RUN: %clang -### -c -O3 -ffunction-sections -grecord-gcc-switches %s 2>&1 \ | // RUN: %clang_bin -### -c -O3 -ffunction-sections -grecord-gcc-switches %s 2>&1 \ | ||||
// | FileCheck -check-prefix=GRECORD_OPT %s | // | FileCheck -check-prefix=GRECORD_OPT %s | ||||
// | // | ||||
// RUN: %clang -### -c -grecord-command-line %s 2>&1 \ | // RUN: %clang_bin -### -c -grecord-command-line %s 2>&1 \ | ||||
// | FileCheck -check-prefix=GRECORD %s | // | FileCheck -check-prefix=GRECORD %s | ||||
// RUN: %clang -### -c -gno-record-command-line %s 2>&1 \ | // RUN: %clang_bin -### -c -gno-record-command-line %s 2>&1 \ | ||||
// | FileCheck -check-prefix=GNO_RECORD %s | // | FileCheck -check-prefix=GNO_RECORD %s | ||||
// RUN: %clang -### -c -grecord-command-line -gno-record-command-line %s 2>&1 \ | // RUN: %clang_bin -### -c -grecord-command-line -gno-record-command-line %s 2>&1 \ | ||||
// | FileCheck -check-prefix=GNO_RECORD %s/ | // | FileCheck -check-prefix=GNO_RECORD %s/ | ||||
// RUN: %clang -### -c -grecord-command-line -o - %s 2>&1 \ | // RUN: %clang_bin -### -c -grecord-command-line -o - %s 2>&1 \ | ||||
// | FileCheck -check-prefix=GRECORD_O %s | // | FileCheck -check-prefix=GRECORD_O %s | ||||
// RUN: %clang -### -c -O3 -ffunction-sections -grecord-command-line %s 2>&1 \ | // RUN: %clang_bin -### -c -O3 -ffunction-sections -grecord-command-line %s 2>&1 \ | ||||
// | FileCheck -check-prefix=GRECORD_OPT %s | // | FileCheck -check-prefix=GRECORD_OPT %s | ||||
// | // | ||||
// RUN: %clang -### -c -gstrict-dwarf -gno-strict-dwarf %s 2>&1 \ | // RUN: %clang_bin -### -c -gstrict-dwarf -gno-strict-dwarf %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GIGNORE %s | // RUN: | FileCheck -check-prefix=GIGNORE %s | ||||
// | // | ||||
// RUN: %clang -### -c -ggnu-pubnames %s 2>&1 | FileCheck -check-prefix=GPUB %s | // RUN: %clang_bin -### -c -ggnu-pubnames %s 2>&1 | FileCheck -check-prefix=GPUB %s | ||||
// RUN: %clang -### -c -ggdb %s 2>&1 | FileCheck -check-prefix=NOPUB %s | // RUN: %clang_bin -### -c -ggdb %s 2>&1 | FileCheck -check-prefix=NOPUB %s | ||||
// RUN: %clang -### -c -ggnu-pubnames -gno-gnu-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s | // RUN: %clang_bin -### -c -ggnu-pubnames -gno-gnu-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s | ||||
// RUN: %clang -### -c -ggnu-pubnames -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s | // RUN: %clang_bin -### -c -ggnu-pubnames -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s | ||||
// | // | ||||
// RUN: %clang -### -c -gpubnames %s 2>&1 | FileCheck -check-prefix=PUB %s | // RUN: %clang_bin -### -c -gpubnames %s 2>&1 | FileCheck -check-prefix=PUB %s | ||||
// RUN: %clang -### -c -ggdb %s 2>&1 | FileCheck -check-prefix=NOPUB %s | // RUN: %clang_bin -### -c -ggdb %s 2>&1 | FileCheck -check-prefix=NOPUB %s | ||||
// RUN: %clang -### -c -gpubnames -gno-gnu-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s | // RUN: %clang_bin -### -c -gpubnames -gno-gnu-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s | ||||
// RUN: %clang -### -c -gpubnames -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s | // RUN: %clang_bin -### -c -gpubnames -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s | ||||
// | // | ||||
// RUN: %clang -### -c -gsplit-dwarf %s 2>&1 | FileCheck -check-prefix=GPUB %s | // RUN: %clang_bin -### -c -gsplit-dwarf %s 2>&1 | FileCheck -check-prefix=GPUB %s | ||||
// RUN: %clang -### -c -gsplit-dwarf -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s | // RUN: %clang_bin -### -c -gsplit-dwarf -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s | ||||
// | // | ||||
// RUN: %clang -### -c -fdebug-ranges-base-address %s 2>&1 | FileCheck -check-prefix=RNGBSE %s | // RUN: %clang_bin -### -c -fdebug-ranges-base-address %s 2>&1 | FileCheck -check-prefix=RNGBSE %s | ||||
// RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s | // RUN: %clang_bin -### -c %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s | ||||
// RUN: %clang -### -c -fdebug-ranges-base-address -fno-debug-ranges-base-address %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s | // RUN: %clang_bin -### -c -fdebug-ranges-base-address -fno-debug-ranges-base-address %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s | ||||
// | // | ||||
// RUN: %clang -### -c -glldb %s 2>&1 | FileCheck -check-prefix=NOPUB %s | // RUN: %clang_bin -### -c -glldb %s 2>&1 | FileCheck -check-prefix=NOPUB %s | ||||
// RUN: %clang -### -c -glldb -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s | // RUN: %clang_bin -### -c -glldb -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s | ||||
// | // | ||||
// RUN: %clang -### -c -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=GARANGE %s | // RUN: %clang_bin -### -c -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=GARANGE %s | ||||
// | // | ||||
// RUN: %clang -### -fdebug-types-section -target x86_64-unknown-linux %s 2>&1 \ | // RUN: %clang_bin -### -fdebug-types-section -target x86_64-unknown-linux %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=FDTS %s | // RUN: | FileCheck -check-prefix=FDTS %s | ||||
// | // | ||||
// RUN: %clang -### -fdebug-types-section -fno-debug-types-section -target x86_64-unknown-linux %s 2>&1 \ | // RUN: %clang_bin -### -fdebug-types-section -fno-debug-types-section -target x86_64-unknown-linux %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=NOFDTS %s | // RUN: | FileCheck -check-prefix=NOFDTS %s | ||||
// | // | ||||
// RUN: %clang -### -fdebug-types-section -target x86_64-apple-darwin %s 2>&1 \ | // RUN: %clang_bin -### -fdebug-types-section -target x86_64-apple-darwin %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=FDTSE %s | // RUN: | FileCheck -check-prefix=FDTSE %s | ||||
// | // | ||||
// RUN: %clang -### -fdebug-types-section -fno-debug-types-section -target x86_64-apple-darwin %s 2>&1 \ | // RUN: %clang_bin -### -fdebug-types-section -fno-debug-types-section -target x86_64-apple-darwin %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=NOFDTSE %s | // RUN: | FileCheck -check-prefix=NOFDTSE %s | ||||
// | // | ||||
// RUN: %clang -### -g -gno-column-info %s 2>&1 \ | // RUN: %clang_bin -### -g -gno-column-info %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=NOCI %s | // RUN: | FileCheck -check-prefix=NOCI %s | ||||
// | // | ||||
// RUN: %clang -### -g -target x86_64-unknown-unknown %s 2>&1 \ | // RUN: %clang_bin -### -g -target x86_64-unknown-unknown %s 2>&1 \ | ||||
// | FileCheck -check-prefix=CI %s | // | FileCheck -check-prefix=CI %s | ||||
// | // | ||||
// RUN: %clang -### -gmodules %s 2>&1 \ | // RUN: %clang_bin -### -gmodules %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GEXTREFS %s | // RUN: | FileCheck -check-prefix=GEXTREFS %s | ||||
// | // | ||||
// RUN: %clang -### -gmodules -g %s 2>&1 \ | // RUN: %clang_bin -### -gmodules -g %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GEXTREFS %s | // RUN: | FileCheck -check-prefix=GEXTREFS %s | ||||
// | // | ||||
// RUN: %clang -### -gline-tables-only -gmodules %s 2>&1 \ | // RUN: %clang_bin -### -gline-tables-only -gmodules %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GEXTREFS %s | // RUN: | FileCheck -check-prefix=GEXTREFS %s | ||||
// | // | ||||
// RUN: %clang -### -gmodules -gline-tables-only %s 2>&1 \ | // RUN: %clang_bin -### -gmodules -gline-tables-only %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GLTO_ONLY %s | // RUN: | FileCheck -check-prefix=GLTO_ONLY %s | ||||
// | // | ||||
// RUN: %clang -### -target %itanium_abi_triple -gmodules -gline-directives-only %s 2>&1 \ | // RUN: %clang_bin -### -target %itanium_abi_triple -gmodules -gline-directives-only %s 2>&1 \ | ||||
// RUN: | FileCheck -check-prefix=GLIO_ONLY %s | // RUN: | FileCheck -check-prefix=GLIO_ONLY %s | ||||
// | // | ||||
// NOG_PS4: "-cc1" | // NOG_PS4: "-cc1" | ||||
// NOG_PS4-NOT: "-dwarf-version= | // NOG_PS4-NOT: "-dwarf-version= | ||||
// NOG_PS4: "-generate-arange-section" | // NOG_PS4: "-generate-arange-section" | ||||
// NOG_PS4-NOT: "-dwarf-version= | // NOG_PS4-NOT: "-dwarf-version= | ||||
// | // | ||||
// G_PS4: "-cc1" | // G_PS4: "-cc1" | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | |||||
// | // | ||||
// CI-NOT: "-gno-column-info" | // CI-NOT: "-gno-column-info" | ||||
// | // | ||||
// NOCI: "-gno-column-info" | // NOCI: "-gno-column-info" | ||||
// | // | ||||
// GEXTREFS: "-dwarf-ext-refs" "-fmodule-format=obj" | // GEXTREFS: "-dwarf-ext-refs" "-fmodule-format=obj" | ||||
// GEXTREFS: "-debug-info-kind={{standalone|limited}}" | // GEXTREFS: "-debug-info-kind={{standalone|limited}}" | ||||
// RUN: not %clang -cc1 -debug-info-kind=watkind 2>&1 | FileCheck -check-prefix=BADSTRING1 %s | // RUN: not %clang_bin -cc1 -debug-info-kind=watkind 2>&1 | FileCheck -check-prefix=BADSTRING1 %s | ||||
// BADSTRING1: error: invalid value 'watkind' in '-debug-info-kind=watkind' | // BADSTRING1: error: invalid value 'watkind' in '-debug-info-kind=watkind' | ||||
// RUN: not %clang -cc1 -debugger-tuning=gmodal 2>&1 | FileCheck -check-prefix=BADSTRING2 %s | // RUN: not %clang_bin -cc1 -debugger-tuning=gmodal 2>&1 | FileCheck -check-prefix=BADSTRING2 %s | ||||
// BADSTRING2: error: invalid value 'gmodal' in '-debugger-tuning=gmodal' | // BADSTRING2: error: invalid value 'gmodal' in '-debugger-tuning=gmodal' | ||||
// RUN: %clang -### -fdebug-macro %s 2>&1 | FileCheck -check-prefix=MACRO %s | // RUN: %clang_bin -### -fdebug-macro %s 2>&1 | FileCheck -check-prefix=MACRO %s | ||||
// RUN: %clang -### -fno-debug-macro %s 2>&1 | FileCheck -check-prefix=NOMACRO %s | // RUN: %clang_bin -### -fno-debug-macro %s 2>&1 | FileCheck -check-prefix=NOMACRO %s | ||||
// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=NOMACRO %s | // RUN: %clang_bin -### %s 2>&1 | FileCheck -check-prefix=NOMACRO %s | ||||
// MACRO: "-debug-info-macro" | // MACRO: "-debug-info-macro" | ||||
// NOMACRO-NOT: "-debug-info-macro" | // NOMACRO-NOT: "-debug-info-macro" | ||||
// | // | ||||
// RUN: %clang -### -gdwarf-5 -gembed-source %s 2>&1 | FileCheck -check-prefix=GEMBED_5 %s | // RUN: %clang_bin -### -gdwarf-5 -gembed-source %s 2>&1 | FileCheck -check-prefix=GEMBED_5 %s | ||||
// RUN: %clang -### -gdwarf-2 -gembed-source %s 2>&1 | FileCheck -check-prefix=GEMBED_2 %s | // RUN: %clang_bin -### -gdwarf-2 -gembed-source %s 2>&1 | FileCheck -check-prefix=GEMBED_2 %s | ||||
// RUN: %clang -### -gdwarf-5 -gno-embed-source %s 2>&1 | FileCheck -check-prefix=NOGEMBED_5 %s | // RUN: %clang_bin -### -gdwarf-5 -gno-embed-source %s 2>&1 | FileCheck -check-prefix=NOGEMBED_5 %s | ||||
// RUN: %clang -### -gdwarf-2 -gno-embed-source %s 2>&1 | FileCheck -check-prefix=NOGEMBED_2 %s | // RUN: %clang_bin -### -gdwarf-2 -gno-embed-source %s 2>&1 | FileCheck -check-prefix=NOGEMBED_2 %s | ||||
// | // | ||||
// GEMBED_5: "-gembed-source" | // GEMBED_5: "-gembed-source" | ||||
// GEMBED_2: error: invalid argument '-gembed-source' only allowed with '-gdwarf-5' | // GEMBED_2: error: invalid argument '-gembed-source' only allowed with '-gdwarf-5' | ||||
// NOGEMBED_5-NOT: "-gembed-source" | // NOGEMBED_5-NOT: "-gembed-source" | ||||
// NOGEMBED_2-NOT: error: invalid argument '-gembed-source' only allowed with '-gdwarf-5' | // NOGEMBED_2-NOT: error: invalid argument '-gembed-source' only allowed with '-gdwarf-5' |