| 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=DWARF3 |
| 3 |
// RUN: %clang -### -Werror --target=x86_64 -gdwarf-4 -fdebug-default-version=2 -S -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF4 |
| 4 |
// RUN: %clang -### -Werror --target=x86_64 -gdwarf-5 -S -fdebug-default-version=2 -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF5 |
| 5 |
// 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=DWARF2 |
| 7 |
// RUN: %clang -### -Werror --target=x86_64 -fdebug-default-version=4 -S -o - %s 2>&1 | FileCheck %s --check-prefixes=NODEBUGINFO,NODWARF4 |
| 8 |
|
| 9 |
// Check which debug info formats we use on Windows. By default, in an MSVC |
| 10 |
// environment, we should use codeview. You can enable dwarf, which implicitly |
| 11 |
// disables codeview, or you can explicitly ask for both if you don't know how |
| 12 |
// 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,NOCODEVIEW |
| 15 |
// 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,CODEVIEW |
| 18 |
|
| 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=DWARF5 |
| 22 |
|
| 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=DWARF2 |
| 24 |
// 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=DWARF3 |
| 25 |
// 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=DWARF4 |
| 26 |
// 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=DWARF5 |
| 27 |
// RUN: %clang -### -Werror -target x86_64-linux-gnu -fdebug-default-version=5 -g -x assembler -c -o - %s 2>&1 | FileCheck %s --check-prefix=DWARF5 |
| 28 |
|
| 29 |
int main(void) { |
| 30 |
return 0; |
| 31 |
} |
| 32 |
|
| 33 |
// NOCODEVIEW-NOT: -gcodeview |
| 34 |
// 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: -gcodeview |
| 44 |
// NODWARF4-NOT: -dwarf-version=4 |