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 // RUN: %clang -target powerpc-ibm-aix-xcoff -g -S -emit-llvm -o - %s | \
36 // RUN:   FileCheck %s --check-prefix=VER3
37 // RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-2 -S -emit-llvm -o - %s | \
38 // RUN:   FileCheck %s --check-prefix=VER2
39 // RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-3 -S -emit-llvm -o - %s | \
40 // RUN:   FileCheck %s --check-prefix=VER3
41 // RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-4 -S -emit-llvm -o - %s | \
42 // RUN:   FileCheck %s --check-prefix=VER4
43 // RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-5 -S -emit-llvm -o - %s | \
44 // RUN:   FileCheck %s --check-prefix=VER5
45 
46 int main (void) {
47   return 0;
48 }
49 
50 // NOCODEVIEW-NOT: !"CodeView"
51 
52 // VER2: !{i32 7, !"Dwarf Version", i32 2}
53 // VER3: !{i32 7, !"Dwarf Version", i32 3}
54 // VER4: !{i32 7, !"Dwarf Version", i32 4}
55 // VER5: !{i32 7, !"Dwarf Version", i32 5}
56 
57 // NODWARF-NOT: !"Dwarf Version"
58 // CODEVIEW: !{i32 2, !"CodeView", i32 1}
59 // NOCODEVIEW-NOT: !"CodeView"
60 // NODWARF-NOT: !"Dwarf Version"
61