brintos

brintos / llvm-project-archived public Read only

0
0
Text · 26.3 KiB · 27e2728 Raw
506 lines · c
1// Check to make sure clang is somewhat picky about -g options.2 3// Linux.4// RUN: %clang -### -c -g %s -target x86_64-linux-gnu 2>&1 \5// RUN:             | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s6// RUN: %clang -### -c -g2 %s -target x86_64-linux-gnu 2>&1 \7// RUN:             | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s8// RUN: %clang -### -c -g3 %s -target x86_64-linux-gnu 2>&1 \9// RUN:             | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s10// RUN: %clang -### -c -ggdb %s -target x86_64-linux-gnu 2>&1 \11// RUN:             | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s12// RUN: %clang -### -c -ggdb1 %s -target x86_64-linux-gnu 2>&1 \13// RUN:             | FileCheck -check-prefix=GLTO_ONLY -check-prefix=G_GDB %s14// RUN: %clang -### -c -ggdb3 %s -target x86_64-linux-gnu 2>&1 \15// RUN:             | FileCheck -check-prefix=G_LIMITED -check-prefix=G_GDB %s16// RUN: %clang -### -c -glldb %s -target x86_64-linux-gnu 2>&1 \17// RUN:             | FileCheck -check-prefix=G_STANDALONE -check-prefix=G_LLDB %s18// RUN: %clang -### -c -gsce %s -target x86_64-linux-gnu 2>&1 \19// RUN:             | FileCheck -check-prefix=G_LIMITED -check-prefix=G_SCE %s20// RUN: %clang -### -c -gdbx %s -target x86_64-linux-gnu 2>&1 \21// RUN:             | FileCheck -check-prefix=G_LIMITED -check-prefix=G_DBX %s22 23// Android.24// Android should always generate DWARF4.25// RUN: %clang -### -c -g %s -target arm-linux-androideabi 2>&1 \26// RUN:             | FileCheck -check-prefix=G_LIMITED -check-prefix=G_DWARF4 %s27 28// Darwin.29// RUN: %clang -### -c -g %s -target x86_64-apple-darwin14 2>&1 \30// RUN:             | FileCheck -check-prefix=G_STANDALONE \31// RUN:                         -check-prefix=G_DWARF2 \32// RUN:                         -check-prefix=G_LLDB %s33// RUN: %clang -### -c -g %s -target x86_64-apple-darwin16 2>&1 \34// RUN:             | FileCheck -check-prefix=G_STANDALONE \35// RUN:                         -check-prefix=G_DWARF4 \36// RUN:                         -check-prefix=G_LLDB %s37// RUN: %clang -### -c -g2 %s -target x86_64-apple-darwin16 2>&1 \38// RUN:             | FileCheck -check-prefix=G_STANDALONE \39// RUN:                         -check-prefix=G_DWARF4 %s40// RUN: %clang -### -c -g3 %s -target x86_64-apple-darwin16 2>&1 \41// RUN:             | FileCheck -check-prefix=G_STANDALONE \42// RUN:                         -check-prefix=G_DWARF4 %s43// RUN: %clang -### -c -ggdb %s -target x86_64-apple-darwin16 2>&1 \44// RUN:             | FileCheck -check-prefix=G_STANDALONE \45// RUN:                         -check-prefix=G_DWARF4 \46// RUN:                         -check-prefix=G_GDB %s47// RUN: %clang -### -c -ggdb1 %s -target x86_64-apple-darwin16 2>&1 \48// RUN:             | FileCheck -check-prefix=GLTO_ONLY %s49// RUN: %clang -### -c -ggdb3 %s -target x86_64-apple-darwin16 2>&1 \50// RUN:             | FileCheck -check-prefix=G_STANDALONE \51// RUN:                         -check-prefix=G_DWARF4 %s52// RUN: %clang -### -c -g %s -target x86_64-apple-macosx10.11 2>&1 \53// RUN:             | FileCheck -check-prefix=G_STANDALONE \54// RUN:                         -check-prefix=G_DWARF4 %s55// RUN: %clang -### -c -g %s -target x86_64-apple-macosx10.10 2>&1 \56// RUN:             | FileCheck -check-prefix=G_ONLY_DWARF2 %s57// RUN: %clang -### -c -g %s -target armv7-apple-ios9.0 2>&1 \58// RUN:             | FileCheck -check-prefix=G_STANDALONE \59// RUN:                         -check-prefix=G_DWARF4 %s60// RUN: %clang -### -c -g %s -target armv7-apple-ios8.0 2>&1 \61// RUN:             | FileCheck -check-prefix=G_ONLY_DWARF2 %s62// RUN: %clang -### -c -g %s -target armv7k-apple-watchos 2>&1 \63// RUN:             | FileCheck -check-prefix=G_STANDALONE \64// RUN:                         -check-prefix=G_DWARF4 %s65// RUN: %clang -### -c -g %s -target arm64-apple-tvos9.0 2>&1 \66// RUN:             | FileCheck -check-prefix=G_STANDALONE \67// RUN:                         -check-prefix=G_DWARF4 %s68// RUN: %clang -### -c -g %s -target x86_64-apple-driverkit19.0 2>&1 \69// RUN:             | FileCheck -check-prefix=G_STANDALONE \70// RUN:                         -check-prefix=G_DWARF4 %s71// RUN: %clang -### -c -g %s -target x86_64-apple-macosx15 2>&1 \72// RUN:             | FileCheck -check-prefix=G_STANDALONE \73// RUN:                         -check-prefix=G_DWARF5 %s74// RUN: %clang -### -c -g %s -target arm64-apple-ios17.0 2>&1 \75// RUN:             | FileCheck -check-prefix=G_STANDALONE \76// RUN:                         -check-prefix=G_DWARF4 %s77// RUN: %clang -### -c -g %s -target arm64-apple-ios18.0 2>&1 \78// RUN:             | FileCheck -check-prefix=G_STANDALONE \79// RUN:                         -check-prefix=G_DWARF5 %s80// RUN: %clang -### -c -g %s -target arm64_32-apple-watchos11 2>&1 \81// RUN:             | FileCheck -check-prefix=G_STANDALONE \82// RUN:                         -check-prefix=G_DWARF5 %s83// RUN: %clang -### -c -g %s -target arm64-apple-tvos18.0 2>&1 \84// RUN:             | FileCheck -check-prefix=G_STANDALONE \85// RUN:                         -check-prefix=G_DWARF5 %s86// RUN: %clang -### -c -g %s -target x86_64-apple-driverkit24.0 2>&1 \87// RUN:             | FileCheck -check-prefix=G_STANDALONE \88// RUN:                         -check-prefix=G_DWARF5 %s89// RUN: %clang -### -c -g %s -target arm64-apple-xros1 2>&1 \90// RUN:             | FileCheck -check-prefix=G_STANDALONE \91// RUN:                         -check-prefix=G_DWARF4 %s92// RUN: %clang -### -c -g %s -target arm64-apple-xros2 2>&1 \93// RUN:             | FileCheck -check-prefix=G_STANDALONE \94// RUN:                         -check-prefix=G_DWARF5 %s95//96// RUN: %clang -### -c -fsave-optimization-record %s    \97// RUN:        -target x86_64-apple-darwin 2>&1 \98// RUN:             | FileCheck -check-prefix=GLTO_ONLY %s99// RUN: %clang -### -c -g -fsave-optimization-record %s \100// RUN:        -target x86_64-apple-darwin 2>&1 \101// RUN:             | FileCheck -check-prefix=G_STANDALONE %s102 103// FreeBSD.104// RUN: %clang -### -c -g %s -target x86_64-pc-freebsd 2>&1 \105// RUN:             | FileCheck -check-prefix=G_GDB \106// RUN:                         -check-prefix=G_DWARF4 %s107 108// Haiku.109// RUN: %clang -### -c -g %s --target=x86_64-unknown-haiku 2>&1 \110// RUN:             | FileCheck -check-prefix=G_STANDALONE \111// RUN:                         -check-prefix=G_DWARF4 %s112 113// Windows.114// RUN: %clang -### -c -g %s -target x86_64-w64-windows-gnu 2>&1 \115// RUN:             | FileCheck -check-prefix=G_GDB %s116// RUN: %clang -### -c -g %s -target x86_64-windows-msvc 2>&1 \117// RUN:             | FileCheck -check-prefix=G_NOTUNING %s118// RUN: %clang_cl -### -c -Z7 -target x86_64-windows-msvc -- %s 2>&1 \119// RUN:             | FileCheck -check-prefix=G_NOTUNING %s120 121// On the PS4/PS5, -g defaults to -gno-column-info. We default to always122// generating the arange section, but keyed off SCE DebuggerTuning being in123// play during codegen, instead of -generate-arange-section.124// RUN: %clang -### -c %s -target x86_64-scei-ps4 2>&1 \125// RUN:             | FileCheck -check-prefix=NOG_PS %s126// RUN: %clang -### -c %s -target x86_64-sie-ps5 2>&1 \127// RUN:             | FileCheck -check-prefix=NOG_PS %s128/// PS4 will stay on v4 even if the generic default version changes.129// RUN: %clang -### -c %s -g -target x86_64-scei-ps4 2>&1 \130// RUN:             | FileCheck -check-prefixes=G_DWARF4,G_SCE,NOCI,FWD_TMPL_PARAMS %s131// RUN: %clang -### -c %s -g -target x86_64-sie-ps5 2>&1 \132// RUN:             | FileCheck -check-prefixes=G_DWARF5,G_SCE,NOCI,FWD_TMPL_PARAMS %s133// RUN: %clang -### -c %s -g -gcolumn-info -target x86_64-scei-ps4 2>&1 \134// RUN:             | FileCheck -check-prefix=CI %s135// RUN: %clang -### -c %s -gsce -target x86_64-unknown-linux 2>&1 \136// RUN:             | FileCheck -check-prefix=NOCI %s137// RUN: %clang -### %s -g -flto=thin -target x86_64-scei-ps4 2>&1 \138// RUN:             | FileCheck -check-prefix=LDGARANGE %s139// RUN: %clang -### %s -g -flto=full -target x86_64-scei-ps4 2>&1 \140// RUN:             | FileCheck -check-prefix=LDGARANGE %s141// RUN: %clang -### %s -g -flto -target x86_64-sie-ps5 2>&1 \142// RUN:             | FileCheck -check-prefix=LDGARANGE %s143// RUN: %clang -### %s -g -target x86_64-sie-ps5 2>&1 \144// RUN:             | FileCheck -check-prefix=LDGARANGE %s145 146// On the AIX, -g defaults to limited debug info.147// RUN: %clang -### -c -g %s -target powerpc-ibm-aix-xcoff 2>&1 \148// RUN:             | FileCheck -check-prefix=G_LIMITED %s149// RUN: %clang -### -c -g %s -target powerpc64-ibm-aix-xcoff 2>&1 \150// RUN:             | FileCheck -check-prefix=G_LIMITED %s151// RUN: %clang -### -c -g %s -target powerpc-ibm-aix-xcoff 2>&1 \152// RUN:             | FileCheck -check-prefix=G_NOTUNING %s153// RUN: %clang -### -c -g %s -target powerpc64-ibm-aix-xcoff 2>&1 \154// RUN:             | FileCheck -check-prefix=G_NOTUNING %s155// RUN: %clang -### -c -g -gdbx %s -target powerpc-ibm-aix-xcoff 2>&1 \156// RUN:             | FileCheck -check-prefixes=G_LIMITED,G_DBX %s157// RUN: %clang -### -c -g -gdbx %s -target powerpc64-ibm-aix-xcoff 2>&1 \158// RUN:             | FileCheck -check-prefixes=G_LIMITED,G_DBX %s159 160// For DBX, -g defaults to -gstrict-dwarf.161// RUN: %clang -### -c -g %s -target powerpc-ibm-aix-xcoff 2>&1 \162// RUN:             | FileCheck -check-prefix=STRICT %s163// RUN: %clang -### -c -g %s -target powerpc64-ibm-aix-xcoff 2>&1 \164// RUN:             | FileCheck -check-prefix=STRICT %s165// RUN: %clang -### -c -g -gno-strict-dwarf %s -target powerpc-ibm-aix-xcoff \166// RUN:             2>&1 | FileCheck -check-prefix=NOSTRICT %s167// RUN: %clang -### -c -g %s -target x86_64-linux-gnu 2>&1 \168// RUN:             | FileCheck -check-prefix=NOSTRICT %s169// RUN: %clang -### -c -g -ggdb %s -target powerpc-ibm-aix-xcoff 2>&1 \170// RUN:             | FileCheck -check-prefix=NOSTRICT %s171 172// On the AIX, -g defaults to -gno-column-info.173// RUN: %clang -### -c -g %s -target powerpc-ibm-aix-xcoff 2>&1 \174// RUN:             | FileCheck -check-prefix=NOCI %s175// RUN: %clang -### -c -g %s -target powerpc64-ibm-aix-xcoff 2>&1 \176// RUN:             | FileCheck -check-prefix=NOCI %s177// RUN: %clang -### -c -g %s -target powerpc-ibm-aix-xcoff -gcolumn-info 2>&1 \178// RUN:             | FileCheck -check-prefix=CI %s179// RUN: %clang -### -c -g %s -target powerpc64-ibm-aix-xcoff -gcolumn-info \180// RUN:             2>&1 | FileCheck -check-prefix=CI %s181 182// WebAssembly.183// WebAssembly should default to DWARF4.184// RUN: %clang -### -c -g %s -target wasm32 2>&1 \185// RUN:             | FileCheck -check-prefix=G_DWARF4 %s186// RUN: %clang -### -c -g %s -target wasm64 2>&1 \187// RUN:             | FileCheck -check-prefix=G_DWARF4 %s188 189// RUN: %clang -### -c -gdwarf-2 %s 2>&1 \190// RUN:             | FileCheck -check-prefix=G_ONLY_DWARF2 %s191//192// RUN: not %clang -### -c -gfoo %s 2>&1 | FileCheck -check-prefix=G_ERR %s193// RUN: %clang -### -c -g -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s194// RUN: %clang -### -c -ggdb0 %s 2>&1 | FileCheck -check-prefix=G_NO %s195// RUN: %clang -### -c -glldb -g0 %s 2>&1 | FileCheck -check-prefix=G_NO %s196// RUN: %clang -### -c -glldb -g1 %s 2>&1 \197// RUN:             | FileCheck -check-prefix=GLTO_ONLY -check-prefix=G_LLDB %s198//199// PS4 defaults to sce; -ggdb0 changes tuning but turns off debug info,200// then -g turns it back on without affecting tuning.201// RUN: %clang -### -c -ggdb0 -g -target x86_64-scei-ps4 %s 2>&1 \202// RUN:             | FileCheck -check-prefix=G_GDB %s203//204// RUN: %clang -### -c -g1 %s 2>&1 \205// RUN:             | FileCheck -check-prefix=GLTO_ONLY %s206// RUN: %clang -### -c -gmlt %s 2>&1 \207// RUN:             | FileCheck -check-prefix=GLTO_ONLY %s208// RUN: %clang -### -c -gline-tables-only %s 2>&1 \209// RUN:             | FileCheck -check-prefix=GLTO_ONLY %s210// RUN: %clang -### -c -gline-tables-only %s -target x86_64-apple-darwin 2>&1 \211// RUN:             | FileCheck -check-prefix=GLTO_ONLY %s212// RUN: %clang -### -c -gline-tables-only %s -target i686-pc-openbsd 2>&1 \213// RUN:             | FileCheck -check-prefix=GLTO_ONLY_DWARF2 %s214// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-linux-gnu 2>&1 \215// RUN:             | FileCheck -check-prefix=G_ONLY %s216// RUN: %clang -### -c -gline-tables-only -g %s -target x86_64-apple-darwin16 2>&1 \217// RUN:             | FileCheck -check-prefix=G_STANDALONE -check-prefix=G_DWARF4 %s218// RUN: %clang -### -c -gline-tables-only -g %s -target i686-pc-openbsd 2>&1 \219// RUN:             | FileCheck -check-prefix=G_ONLY_DWARF2 %s220// RUN: %clang -### -c -gline-tables-only -g %s --target=i386-pc-solaris 2>&1 \221// RUN:             | FileCheck -check-prefix=G_ONLY %s222// RUN: %clang -### -c -gline-tables-only -g0 %s 2>&1 \223// RUN:             | FileCheck -check-prefix=GLTO_NO %s224//225// RUN: %clang -### -c -gline-directives-only %s -target x86_64-apple-darwin 2>&1 \226// RUN:             | FileCheck -check-prefix=GLIO_ONLY %s227// RUN: %clang -### -c -gline-directives-only %s -target i686-pc-openbsd 2>&1 \228// RUN:             | FileCheck -check-prefix=GLIO_ONLY_DWARF2 %s229// RUN: %clang -### -c -gline-directives-only -g %s -target x86_64-linux-gnu 2>&1 \230// RUN:             | FileCheck -check-prefix=G_ONLY %s231// RUN: %clang -### -c -gline-directives-only -g %s -target x86_64-apple-darwin16 2>&1 \232// RUN:             | FileCheck -check-prefix=G_STANDALONE -check-prefix=G_DWARF4 %s233// RUN: %clang -### -c -gline-directives-only -g %s -target i686-pc-openbsd 2>&1 \234// RUN:             | FileCheck -check-prefix=G_ONLY_DWARF2 %s235// RUN: %clang -### -c -gline-directives-only -g %s --target=i386-pc-solaris 2>&1 \236// RUN:             | FileCheck -check-prefix=G_ONLY %s237// RUN: %clang -### -c -gline-directives-only -g0 %s 2>&1 \238// RUN:             | FileCheck -check-prefix=GLIO_NO %s239 240// RUN: %clang -### -c -grecord-gcc-switches %s 2>&1 | FileCheck -check-prefix=GRECORD %s241// RUN: %clang -### -c -gno-record-gcc-switches %s 2>&1 | FileCheck -check-prefix=GNO_RECORD %s242// RUN: %clang -### -c -grecord-gcc-switches -gno-record-gcc-switches %s 2>&1 | FileCheck -check-prefix=GNO_RECORD %s243// RUN: %clang -### -c -grecord-gcc-switches -o - %s 2>&1 | FileCheck -check-prefix=GRECORD_O %s244// RUN: %clang -### -c -O3 -ffunction-sections -grecord-gcc-switches %s 2>&1 | FileCheck -check-prefix=GRECORD_OPT %s245 246// RUN: %clang -### -c -grecord-command-line %s 2>&1 | FileCheck -check-prefix=GRECORD %s247// RUN: %clang -### -c -gno-record-command-line %s 2>&1 | FileCheck -check-prefix=GNO_RECORD %s248// RUN: %clang -### -c -grecord-command-line -gno-record-command-line %s 2>&1 | FileCheck -check-prefix=GNO_RECORD %s249// RUN: %clang -### -c -grecord-command-line -o - %s 2>&1 | FileCheck -check-prefix=GRECORD_O %s250// RUN: %clang -### -c -O3 -ffunction-sections -grecord-command-line %s 2>&1 | FileCheck -check-prefix=GRECORD_OPT %s251 252// RUN: %clang -### -c -gstrict-dwarf -gno-strict-dwarf %s 2>&1 | FileCheck -check-prefix=GIGNORE %s253 254// RUN: %clang -### -c -ggnu-pubnames %s 2>&1 | FileCheck -check-prefix=GPUB %s255// RUN: %clang -### -c -ggdb %s 2>&1 | FileCheck -check-prefix=NOPUB %s256// RUN: %clang -### -c -ggnu-pubnames -gno-gnu-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s257// RUN: %clang -### -c -ggnu-pubnames -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s258//259// RUN: %clang -### -c -gpubnames %s 2>&1 | FileCheck -check-prefix=PUB %s260// RUN: %clang -### -c -ggdb %s 2>&1 | FileCheck -check-prefix=NOPUB %s261// RUN: %clang -### -c -gpubnames -gno-gnu-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s262// RUN: %clang -### -c -gpubnames -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s263 264/// Specify --target= so that %clang doesn't exit with code 1 even if LLVM_DEFAULT_TARGET_TRIPLE specifies a RISC-V target triple.265// RUN: %clang -### --target=x86_64 -c -gsplit-dwarf -g -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s266//267// RUN: %clang -### -c -fdebug-ranges-base-address %s 2>&1 | FileCheck -check-prefix=RNGBSE %s268// RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s269// RUN: %clang -### -c -fdebug-ranges-base-address -fno-debug-ranges-base-address %s 2>&1 | FileCheck -check-prefix=NORNGBSE %s270//271// RUN: %clang -### -c -g -gomit-unreferenced-methods -fno-standalone-debug %s 2>&1 | FileCheck -check-prefix=INCTYPES %s272// RUN: %clang -### -c %s 2>&1 | FileCheck -check-prefix=NOINCTYPES %s273// RUN: %clang -### -c -g -gomit-unreferenced-methods -fdebug-types-section -target x86_64-unknown-linux %s 2>&1 \274// RUN:        | FileCheck -check-prefix=NOINCTYPES %s275// RUN: %clang -### -c -g -gomit-unreferenced-methods -fstandalone-debug %s 2>&1 | FileCheck -check-prefix=NOINCTYPES %s276//277// RUN: %clang -### -c -glldb %s 2>&1 | FileCheck -check-prefix=NOPUB %s278// RUN: %clang -### -c -glldb -gno-pubnames %s 2>&1 | FileCheck -check-prefix=NOPUB %s279//280// RUN: %clang -### -c -gdwarf-aranges %s 2>&1 | FileCheck -check-prefix=GARANGE %s281//282// RUN: %clang -### -fdebug-types-section -target x86_64-unknown-linux %s 2>&1 \283// RUN:        | FileCheck -check-prefix=FDTS %s284//285// RUN: %clang -### -fdebug-types-section -fno-debug-types-section -target x86_64-unknown-linux %s 2>&1 \286// RUN:        | FileCheck -check-prefix=NOFDTS %s287//288// RUN: %clang -### -fdebug-types-section -target wasm32-unknown-unknown %s 2>&1 \289// RUN:        | FileCheck -check-prefix=FDTS %s290//291// RUN: not %clang -### -fdebug-types-section -target x86_64-apple-darwin %s 2>&1 \292// RUN:        | FileCheck -check-prefix=FDTSE %s293//294// RUN: %clang -### -fdebug-types-section -fno-debug-types-section -target x86_64-apple-darwin %s 2>&1 \295// RUN:        | FileCheck -check-prefix=NOFDTSE %s296//297// RUN: %clang -### -g -gno-column-info %s 2>&1 \298// RUN:        | FileCheck -check-prefix=NOCI %s299//300// RUN: %clang -### -g -gno-call-site-info %s 2>&1 \301// RUN:        | FileCheck -check-prefix=NOCALLSITE %s302//303// RUN: %clang -### -g -target x86_64-unknown-unknown %s 2>&1 \304//             | FileCheck -check-prefix=CI %s305//306// RUN: %clang -### -gmodules %s 2>&1 \307// RUN:        | FileCheck -check-prefix=GEXTREFS %s308//309// RUN: %clang -### -gmodules -g %s 2>&1 \310// RUN:        | FileCheck -check-prefix=GEXTREFS %s311//312// RUN: %clang -### -gline-tables-only -gmodules %s 2>&1 \313// RUN:        | FileCheck -check-prefix=GEXTREFS %s314//315// RUN: %clang -### -gmodules -gline-tables-only %s 2>&1 \316// RUN:        | FileCheck -check-prefix=GLTO_ONLY %s317//318// RUN: %clang -### -target %itanium_abi_triple -gmodules -gline-directives-only %s 2>&1 \319// RUN:        | FileCheck -check-prefix=GLIO_ONLY %s320//321// RUN: %clang -### -gmodules -gno-modules %s 2>&1 \322// RUN:        | FileCheck -check-prefix=NOGEXTREFS %s323//324// RUN: %clang -### -gno-modules %s 2>&1 | FileCheck -check-prefix=GNOMOD %s325//326// NOG_PS: "-cc1"327// NOG_PS-NOT: "-dwarf-version=328// NOG_PS-NOT: "-generate-arange-section"329//330// G_ERR: error: unknown argument:331//332// G_NO: "-cc1"333// G_NO-NOT: -debug-info-kind=334//335// GLTO_ONLY: "-cc1"336// GLTO_ONLY-NOT: "-dwarf-ext-refs"337// GLTO_ONLY: "-debug-info-kind=line-tables-only"338// GLTO_ONLY-NOT: "-dwarf-ext-refs"339//340// GLTO_ONLY_DWARF2: "-cc1"341// GLTO_ONLY_DWARF2: "-debug-info-kind=line-tables-only"342// GLTO_ONLY_DWARF2: "-dwarf-version=2"343//344// GLIO_ONLY: "-cc1"345// GLIO_ONLY-NOT: "-dwarf-ext-refs"346// GLIO_ONLY: "-debug-info-kind=line-directives-only"347// GLIO_ONLY-NOT: "-dwarf-ext-refs"348//349// GLIO_ONLY_DWARF2: "-cc1"350// GLIO_ONLY_DWARF2: "-debug-info-kind=line-directives-only"351// GLIO_ONLY_DWARF2: "-dwarf-version=2"352//353// G_ONLY: "-cc1"354// G_ONLY: "-debug-info-kind=constructor"355//356// These tests assert that "-gline-tables-only" "-g" uses the latter,357// but otherwise not caring about the DebugInfoKind.358// G_ONLY_DWARF2: "-cc1"359// G_ONLY_DWARF2: "-debug-info-kind={{standalone|constructor}}"360// G_ONLY_DWARF2: "-dwarf-version=2"361//362// G_STANDALONE: "-cc1"363// G_STANDALONE: "-debug-info-kind=standalone"364// G_LIMITED: "-cc1"365// G_LIMITED: "-debug-info-kind=constructor"366// G_DWARF2: "-dwarf-version=2"367// G_DWARF4-DAG: "-dwarf-version=4"368// G_DWARF5-DAG: "-dwarf-version=5"369//370// G_GDB:  "-debugger-tuning=gdb"371// G_LLDB: "-debugger-tuning=lldb"372// G_SCE-DAG:  "-debugger-tuning=sce"373// G_DBX:  "-debugger-tuning=dbx"374//375// STRICT:  "-gstrict-dwarf"376// NOSTRICT-NOT:  "-gstrict-dwarf"377//378// G_NOTUNING: "-cc1"379// G_NOTUNING-NOT: "-debugger-tuning="380//381// This tests asserts that "-gline-tables-only" "-g0" disables debug info.382// GLTO_NO: "-cc1"383// GLTO_NO-NOT: -debug-info-kind=384//385// This tests asserts that "-gline-directives-only" "-g0" disables debug info.386// GLIO_NO: "-cc1"387// GLIO_NO-NOT: -debug-info-kind=388//389// GRECORD: "-dwarf-debug-flags"390// GRECORD: -### -c -grecord-command-line391//392// GNO_RECORD-NOT: "-dwarf-debug-flags"393// GNO_RECORD-NOT: -### -c -grecord-command-line394//395// GRECORD_O: "-dwarf-debug-flags"396// GRECORD_O: -### -c -grecord-command-line -o -397//398// GRECORD_OPT: -### -c -O3 -ffunction-sections -grecord-command-line399//400// GIGNORE-NOT: "argument unused during compilation"401//402// GPUB: -ggnu-pubnames403// NOPUB-NOT: -ggnu-pubnames404// NOPUB-NOT: -gpubnames405//406 407// LDGARANGE: {{".*ld.*"}} {{.*}}408// LDGARANGE-NOT: -generate-arange-section"409// SNLDTLTOGARANGE: {{".*orbis-ld.*"}} {{.*}} "-lto-thin-debug-options= -generate-arange-section"410// SNLDFLTOGARANGE: {{".*orbis-ld.*"}} {{.*}} "-lto-debug-options= -generate-arange-section"411 412// PUB: -gpubnames413//414// RNGBSE: -fdebug-ranges-base-address415// NORNGBSE-NOT: -fdebug-ranges-base-address416//417// INCTYPES: -gomit-unreferenced-methods418// NOINCTYPES-NOT: -gomit-unreferenced-methods419//420// GARANGE-DAG: -generate-arange-section421//422// FDTS: "-mllvm" "-generate-type-units"423// FDTSE: error: unsupported option '-fdebug-types-section' for target 'x86_64-apple-darwin'424//425// NOFDTS-NOT: "-mllvm" "-generate-type-units"426// NOFDTSE-NOT: error: unsupported option '-fdebug-types-section' for target 'x86_64-apple-darwin'427//428// CI-NOT: "-gno-column-info"429//430// NOCI-DAG: "-gno-column-info"431//432// NOCALLSITE: "-gno-call-site-info"433//434// GEXTREFS: "-dwarf-ext-refs" "-fmodule-format=obj"435// GEXTREFS: "-debug-info-kind={{standalone|constructor}}"436// NOGEXTREFS-NOT: -dwarf-ext-refs437//438// GNOMOD-NOT: -debug-info-kind=439 440// RUN: not %clang -cc1 -debug-info-kind=watkind 2>&1 | FileCheck -check-prefix=BADSTRING1 %s441// BADSTRING1: error: invalid value 'watkind' in '-debug-info-kind=watkind'442// RUN: not %clang -cc1 -debugger-tuning=gmodal 2>&1 | FileCheck -check-prefix=BADSTRING2 %s443// BADSTRING2: error: invalid value 'gmodal' in '-debugger-tuning=gmodal'444 445// RUN: %clang -### -fdebug-macro    %s 2>&1 | FileCheck -check-prefix=MACRO %s446// RUN: %clang -### -fno-debug-macro %s 2>&1 | FileCheck -check-prefix=NOMACRO %s447// RUN: %clang -###                  %s 2>&1 | FileCheck -check-prefix=NOMACRO %s448// MACRO: "-debug-info-macro"449// NOMACRO-NOT: "-debug-info-macro"450//451// RUN: %clang -### -g -fno-eliminate-unused-debug-types -c %s 2>&1 \452// RUN:        | FileCheck -check-prefix=DEBUG_UNUSED_TYPES %s453// DEBUG_UNUSED_TYPES: "-debug-info-kind=unused-types"454// DEBUG_UNUSED_TYPES-NOT: "-debug-info-kind=limited"455// RUN: %clang -### -g -feliminate-unused-debug-types -c %s 2>&1 \456// RUN:        | FileCheck -check-prefix=NO_DEBUG_UNUSED_TYPES %s457// RUN: %clang -### -fno-eliminate-unused-debug-types -g1 -c %s 2>&1 \458// RUN:        | FileCheck -check-prefix=NO_DEBUG_UNUSED_TYPES %s459// NO_DEBUG_UNUSED_TYPES: "-debug-info-kind={{constructor|line-tables-only|standalone}}"460// NO_DEBUG_UNUSED_TYPES-NOT: "-debug-info-kind=unused-types"461//462// RUN: %clang -### -c -gdwarf-5 -gdwarf64 -target x86_64 %s 2>&1 | FileCheck -check-prefix=GDWARF64_ON %s463// RUN: %clang -### -c -gdwarf-4 -gdwarf64 -target x86_64 %s 2>&1 | FileCheck -check-prefix=GDWARF64_ON %s464// RUN: %clang -### -c -gdwarf-3 -gdwarf64 -target x86_64 %s 2>&1 | FileCheck -check-prefix=GDWARF64_ON %s465// RUN: not %clang -### -c -gdwarf-2 -gdwarf64 --target=x86_64 %s 2>&1 | FileCheck -check-prefix=GDWARF64_VER %s466// RUN: %clang -### -c -gdwarf-4 -gdwarf64 -target x86_64 -target x86_64 %s 2>&1 \467// RUN:       | FileCheck -check-prefix=GDWARF64_ON %s468// RUN: not %clang -### -c -gdwarf-4 -gdwarf64 --target=i386-linux-gnu %s 2>&1 \469// RUN:       | FileCheck -check-prefix=GDWARF64_32ARCH %s470// RUN: not %clang -### -c -gdwarf-4 -gdwarf64 -target x86_64-apple-darwin %s 2>&1 \471// RUN:       | FileCheck -check-prefix=GDWARF64_ELF %s472//473// GDWARF64_ON:  "-gdwarf64"474// GDWARF64_VER:  error: invalid argument '-gdwarf64' only allowed with 'DWARFv3 or greater'475// GDWARF64_32ARCH: error: invalid argument '-gdwarf64' only allowed with '64 bit architecture'476// GDWARF64_ELF: error: invalid argument '-gdwarf64' only allowed with 'ELF platforms'477 478/// Default to -fno-dwarf-directory-asm for -fno-integrated-as before DWARF v5.479// RUN: %clang -### -target x86_64 -c -gdwarf-2 %s 2>&1 | FileCheck --check-prefix=DIRECTORY %s480// RUN: %clang -### -target x86_64 -c -gdwarf-5 %s 2>&1 | FileCheck --check-prefix=DIRECTORY %s481// RUN: %clang -### -target x86_64 -c -gdwarf-4 -fno-integrated-as %s 2>&1 | FileCheck --check-prefix=NODIRECTORY %s482// RUN: %clang -### -target x86_64 -c -gdwarf-5 -fno-integrated-as %s 2>&1 | FileCheck --check-prefix=DIRECTORY %s483 484// RUN: %clang -### -target x86_64 -c -gdwarf-4 -fno-dwarf-directory-asm %s 2>&1 | FileCheck --check-prefix=NODIRECTORY %s485 486// DIRECTORY-NOT: "-fno-dwarf-directory-asm"487// NODIRECTORY: "-fno-dwarf-directory-asm"488 489// RUN: %clang -### -target x86_64 -c -g -gsimple-template-names %s 2>&1 | FileCheck --check-prefixes=SIMPLE_TMPL_NAMES,FWD_TMPL_PARAMS %s490// SIMPLE_TMPL_NAMES: -gsimple-template-names=simple491// FWD_TMPL_PARAMS-DAG: -debug-forward-template-params492// RUN: not %clang -### -target x86_64 -c -g -gsimple-template-names=mangled %s 2>&1 | FileCheck --check-prefix=MANGLED_TEMP_NAMES %s493// MANGLED_TEMP_NAMES: error: unknown argument '-gsimple-template-names=mangled'; did you mean '-Xclang -gsimple-template-names=mangled'494// RUN: %clang -### -target x86_64 -c -g %s 2>&1 | FileCheck --check-prefix=FULL_TEMP_NAMES --implicit-check-not=debug-forward-template-params %s495// FULL_TEMP_NAMES-NOT: -gsimple-template-names496 497//// Test -g[no-]template-alias (enabled by default with SCE debugger tuning and DWARF version >= 4).498// RUN: %clang -### -target x86_64 -c -gdwarf-5 -gsce %s 2>&1 | FileCheck %s --check-prefixes=TEMPLATE-ALIAS499// RUN: %clang -### -target x86_64 -c -gdwarf-3 -gsce %s 2>&1 | FileCheck %s --check-prefixes=NO-TEMPLATE-ALIAS500// RUN: %clang -### -target x86_64 -c -gdwarf-5 -gsce -gtemplate-alias %s 2>&1 | FileCheck %s --check-prefixes=TEMPLATE-ALIAS501// RUN: %clang -### -target x86_64 -c -gdwarf-5 -gsce -gno-template-alias %s 2>&1 | FileCheck %s --check-prefixes=NO-TEMPLATE-ALIAS502// RUN: %clang -### -target x86_64 -c -gdwarf-5 -gtemplate-alias %s 2>&1 | FileCheck %s --check-prefixes=TEMPLATE-ALIAS503// RUN: %clang -### -target x86_64 -c -gdwarf-5 -gtemplate-alias -gno-template-alias %s 2>&1 | FileCheck %s --check-prefixes=NO-TEMPLATE-ALIAS504// TEMPLATE-ALIAS: "-gtemplate-alias"505// NO-TEMPLATE-ALIAS-NOT: "-gtemplate-alias"506