45 lines · c
1// RUN: %clang -### -Werror --target=x86_64 -fdebug-default-version=4 -gdwarf-2 -S -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF2 --implicit-check-not=warning:2// RUN: %clang -### -Werror --target=x86_64 -gdwarf-3 -fdebug-default-version=4 -S -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF33// RUN: %clang -### -Werror --target=x86_64 -gdwarf-4 -fdebug-default-version=2 -S -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF44// RUN: %clang -### -Werror --target=x86_64 -gdwarf-5 -S -fdebug-default-version=2 -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF55// RUN: %clang -### -Werror --target=x86_64 -fdebug-default-version=5 -g -S -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF5 --implicit-check-not=warning:6// RUN: %clang -### -Werror --target=x86_64 -gdwarf -fdebug-default-version=2 -S -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF27// RUN: %clang -### -Werror --target=x86_64 -fdebug-default-version=4 -S -o - %s 2>&1 | FileCheck %s --check-prefixes=NODEBUGINFO,NODWARF48 9// Check which debug info formats we use on Windows. By default, in an MSVC10// environment, we should use codeview. You can enable dwarf, which implicitly11// disables codeview, or you can explicitly ask for both if you don't know how12// the app will be debugged.13// RUN: %clang -### -Werror -target i686-pc-windows-msvc -fdebug-default-version=2 -gdwarf -S -o - %s 2>&1 \14// RUN: | FileCheck %s --check-prefixes=DWARF2,NOCODEVIEW15// Explicitly request both.16// RUN: %clang -### -Werror -target i686-pc-windows-msvc -fdebug-default-version=4 -gdwarf -gcodeview -S -o - %s 2>&1 \17// RUN: | FileCheck %s --check-prefixes=DWARF4,CODEVIEW18 19// Do Assembler testing most of the same test cases as those above.20 21// RUN: %clang -### -Werror -target x86_64-linux-gnu -fdebug-default-version=5 -g -x assembler -c -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF522 23// RUN: %clang -### -Werror -target x86_64-linux-gnu -fdebug-default-version=4 -gdwarf-2 -x assembler -c -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF224// RUN: %clang -### -Werror -target x86_64-linux-gnu -gdwarf-3 -fdebug-default-version=4 -x assembler -c -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF325// RUN: %clang -### -Werror -target x86_64-linux-gnu -gdwarf-4 -fdebug-default-version=2 -x assembler -c -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF426// RUN: %clang -### -Werror -target x86_64-linux-gnu -gdwarf-5 -x assembler -c -fdebug-default-version=2 -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF527// RUN: %clang -### -Werror -target x86_64-linux-gnu -fdebug-default-version=5 -g -x assembler -c -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF528 29int main(void) {30 return 0;31}32 33// NOCODEVIEW-NOT: -gcodeview34// CODEVIEW: "-gcodeview"35 36// NODEBUGINFO-NOT: -debug-info-kind=37 38// DWARF2: "-dwarf-version=2"39// DWARF3: "-dwarf-version=3"40// DWARF4: "-dwarf-version=4"41// DWARF5: "-dwarf-version=5"42 43// NOCODEVIEW-NOT: -gcodeview44// NODWARF4-NOT: -dwarf-version=445