1 // RUN: %clang -target x86_64-linux-gnu -gdwarf-2 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER2
2 // RUN: %clang -target x86_64-linux-gnu -gdwarf-3 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER3
3 // RUN: %clang -target x86_64-linux-gnu -gdwarf-4 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4
4 // RUN: %clang -target x86_64-linux-gnu -gdwarf-5 -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5
5 // RUN: %clang -target x86_64-linux-gnu -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5
6 // RUN: %clang -target x86_64-linux-gnu -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5
7 // RUN: %clang --target=i386-pc-solaris -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5
8 // RUN: %clang --target=i386-pc-solaris -gdwarf -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER5
10 // The -isysroot is used as a hack to avoid LIT messing with the SDKROOT
11 // environment variable which indirecty overrides the version in the target
13 // RUN: %clang -target x86_64-apple-macosx10.11 -g -S -emit-llvm -o - %s -isysroot %t | FileCheck %s --check-prefix=VER4
14 // RUN: %clang -target x86_64-apple-darwin14 -g -S -emit-llvm -o - %s -isysroot %t | FileCheck %s --check-prefix=VER2
16 // RUN: %clang -target powerpc-unknown-openbsd -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER2
17 // RUN: %clang --target=x86_64-unknown-haiku -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4
18 // RUN: %clang -target powerpc-unknown-freebsd -g -S -emit-llvm -o - %s | FileCheck %s --check-prefix=VER4
20 // Check which debug info formats we use on Windows. By default, in an MSVC
21 // environment, we should use codeview. You can enable dwarf, which implicitly
22 // disables codeview, of you can explicitly ask for both if you don't know how
23 // the app will be debugged.
24 // Default is codeview.
25 // RUN: %clang -target i686-pc-windows-msvc -g -S -emit-llvm -o - %s \
26 // RUN: | FileCheck %s --check-prefixes=NODWARF,CODEVIEW
27 // Explicitly request codeview.
28 // RUN: %clang -target i686-pc-windows-msvc -gcodeview -S -emit-llvm -o - %s \
29 // RUN: | FileCheck %s --check-prefixes=NODWARF,CODEVIEW
30 // Explicitly request DWARF.
31 // RUN: %clang -target i686-pc-windows-msvc -gdwarf -S -emit-llvm -o - %s \
32 // RUN: | FileCheck %s --check-prefixes=VER4,NOCODEVIEW
33 // Explicitly request both.
34 // RUN: %clang -target i686-pc-windows-msvc -gdwarf -gcodeview -S -emit-llvm -o - %s \
35 // RUN: | FileCheck %s --check-prefixes=VER4,CODEVIEW
37 // Check what version of dwarf is used for MinGW targets.
38 // RUN: %clang -target i686-pc-windows-gnu -g -S -emit-llvm -o - %s | \
39 // RUN: FileCheck %s --check-prefixes=VER4
41 // RUN: %clang -target powerpc-ibm-aix-xcoff -g -S -emit-llvm -o - %s | \
42 // RUN: FileCheck %s --check-prefix=VER3
43 // RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-2 -S -emit-llvm -o - %s | \
44 // RUN: FileCheck %s --check-prefix=VER2
45 // RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-3 -S -emit-llvm -o - %s | \
46 // RUN: FileCheck %s --check-prefix=VER3
47 // RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-4 -S -emit-llvm -o - %s | \
48 // RUN: FileCheck %s --check-prefix=VER4
49 // RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-5 -S -emit-llvm -o - %s | \
50 // RUN: FileCheck %s --check-prefix=VER5
56 // NOCODEVIEW-NOT: !"CodeView"
58 // VER2: !{i32 7, !"Dwarf Version", i32 2}
59 // VER3: !{i32 7, !"Dwarf Version", i32 3}
60 // VER4: !{i32 7, !"Dwarf Version", i32 4}
61 // VER5: !{i32 7, !"Dwarf Version", i32 5}
63 // NODWARF-NOT: !"Dwarf Version"
64 // CODEVIEW: !{i32 2, !"CodeView", i32 1}
65 // NOCODEVIEW-NOT: !"CodeView"
66 // NODWARF-NOT: !"Dwarf Version"