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