72 lines · c
1// RUN: %clang -target x86_64-linux-gnu -gdwarf-2 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER22// RUN: %clang -target x86_64-linux-gnu -gdwarf-3 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER33// RUN: %clang -target x86_64-linux-gnu -gdwarf-4 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER44// RUN: %clang -target x86_64-linux-gnu -gdwarf-5 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER55// RUN: %clang -target x86_64-linux-gnu -gdwarf-6 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER66// RUN: %clang -target x86_64-linux-gnu -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER57// RUN: %clang -target x86_64-linux-gnu -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER58// RUN: %clang --target=i386-pc-solaris -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER59// RUN: %clang --target=i386-pc-solaris -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER510 11// The -isysroot is used as a hack to avoid LIT messing with the SDKROOT12// environment variable which indirecty overrides the version in the target13// triple used here.14// RUN: %clang -target x86_64-apple-macosx10.11 -g -S -emit-llvm -o - %s -isysroot %t | FileCheck %s --check-prefix=VER415// RUN: %clang -target x86_64-apple-darwin14 -g -S -emit-llvm -o - %s -isysroot %t | FileCheck %s --check-prefix=VER216 17// RUN: %clang -target powerpc-unknown-openbsd -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER218// RUN: %clang --target=x86_64-unknown-haiku -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER419// RUN: %clang -target powerpc-unknown-freebsd -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER420 21// Check which debug info formats we use on Windows. By default, in an MSVC22// environment, we should use codeview. You can enable dwarf, which implicitly23// disables codeview, of you can explicitly ask for both if you don't know how24// the app will be debugged.25// Default is codeview.26// RUN: %clang -target i686-pc-windows-msvc -g -S -emit-llvm -o - %s \27// RUN: | FileCheck %s --check-prefixes=NODWARF,CODEVIEW28// Explicitly request codeview.29// RUN: %clang -target i686-pc-windows-msvc -gcodeview -S -emit-llvm -o - %s \30// RUN: | FileCheck %s --check-prefixes=NODWARF,CODEVIEW31// Explicitly request DWARF.32// RUN: %clang -target i686-pc-windows-msvc -gdwarf -S -emit-llvm -o - %s \33// RUN: | FileCheck %s --check-prefixes=VER4,NOCODEVIEW34// Explicitly request both.35// RUN: %clang -target i686-pc-windows-msvc -gdwarf -gcodeview -S -emit-llvm -o - %s \36// RUN: | FileCheck %s --check-prefixes=VER4,CODEVIEW37 38// Check what version of dwarf is used for MinGW targets.39// RUN: %clang -target i686-pc-windows-gnu -g -S -emit-llvm -o - %s | \40// RUN: FileCheck %s --check-prefixes=VER441 42// RUN: %clang -target powerpc-ibm-aix-xcoff -g -S -emit-llvm -o - %s | \43// RUN: FileCheck %s --check-prefix=VER344// RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-2 -S -emit-llvm -o - %s | \45// RUN: FileCheck %s --check-prefix=VER246// RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-3 -S -emit-llvm -o - %s | \47// RUN: FileCheck %s --check-prefix=VER348// RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-4 -S -emit-llvm -o - %s | \49// RUN: FileCheck %s --check-prefix=VER450// RUN: not %clang -target powerpc-ibm-aix-xcoff -gdwarf-5 -S -emit-llvm -o - %s 2>&1 | \51// RUN: FileCheck %s --check-prefix=UNSUPPORTED-VER552// RUN: not %clang -target powerpc64-ibm-aix-xcoff -gdwarf-5 -S -emit-llvm -o - %s 2>&1| \53// RUN: FileCheck %s --check-prefix=UNSUPPORTED-VER554 55int main (void) {56 return 0;57}58 59// NOCODEVIEW-NOT: !"CodeView"60 61// VER2: !{i32 7, !"Dwarf Version", i32 2}62// VER3: !{i32 7, !"Dwarf Version", i32 3}63// VER4: !{i32 7, !"Dwarf Version", i32 4}64// VER5: !{i32 7, !"Dwarf Version", i32 5}65// VER6: !{i32 7, !"Dwarf Version", i32 6}66// UNSUPPORTED-VER5: error: unsupported option '-gdwarf-5'67 68// NODWARF-NOT: !"Dwarf Version"69// CODEVIEW: !{i32 2, !"CodeView", i32 1}70// NOCODEVIEW-NOT: !"CodeView"71// NODWARF-NOT: !"Dwarf Version"72