1 // Check that we split debug output properly
2 //
3 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -c -### %s 2> %t
4 // RUN: FileCheck -check-prefix=CHECK-ACTIONS < %t %s
5 //
6 // CHECK-ACTIONS: "-split-dwarf-file" "split-debug.dwo"
7 
8 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -c -### %s 2> %t
9 // RUN: FileCheck -check-prefix=CHECK-ACTIONS < %t %s
10 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=split -c -### %s 2> %t
11 // RUN: FileCheck -check-prefix=CHECK-ACTIONS < %t %s
12 
13 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=single -c -### %s 2> %t
14 // RUN: FileCheck -check-prefix=CHECK-ACTIONS-SINGLE-SPLIT < %t %s
15 //
16 // CHECK-ACTIONS-SINGLE-SPLIT: "-enable-split-dwarf=single"
17 // CHECK-ACTIONS-SINGLE-SPLIT: "-split-dwarf-file" "split-debug.o"
18 
19 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=single -c -### -o %tfoo.o %s 2> %t
20 // RUN: FileCheck -check-prefix=CHECK-SINGLE-SPLIT-FILENAME < %t %s
21 //
22 // CHECK-SINGLE-SPLIT-FILENAME: "-split-dwarf-file" "{{.*}}foo.o"
23 
24 // RUN: %clang -target x86_64-macosx -gsplit-dwarf -c -### %s 2> %t
25 // RUN: FileCheck -check-prefix=CHECK-NO-ACTIONS < %t %s
26 //
27 // CHECK-NO-ACTIONS-NOT: -split-dwarf
28 
29 
30 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -o Bad.x -### %s 2> %t
31 // RUN: FileCheck -check-prefix=CHECK-BAD < %t %s
32 //
33 // CHECK-BAD-NOT: "Bad.dwo"
34 
35 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -c -### %s 2> %t
36 // RUN: FileCheck -check-prefix=CHECK-OPTION < %t %s
37 //
38 // RUN: %clang -target x86_64-pc-freebsd12 -gsplit-dwarf -c -### %s 2> %t
39 // RUN: FileCheck -check-prefix=CHECK-OPTION < %t %s
40 //
41 // RUN: %clang -target amdgcn-amd-amdhsa -gsplit-dwarf -c -### %s 2> %t
42 // RUN: FileCheck -check-prefix=CHECK-OPTION < %t %s
43 //
44 // CHECK-OPTION: "-split-dwarf-file" "split-debug.dwo"
45 
46 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -S -### %s 2> %t
47 // RUN: FileCheck -check-prefix=CHECK-ASM < %t %s
48 //
49 // CHECK-ASM-NOT: objcopy
50 
51 // RUN: %clang -target x86_64-unknown-linux-gnu -no-integrated-as -gsplit-dwarf -c -### %s 2> %t
52 // RUN: FileCheck -check-prefix=CHECK-IAS < %t %s
53 //
54 // CHECK-IAS: objcopy
55 
56 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -gmlt -fno-split-dwarf-inlining -S -### %s 2> %t
57 // RUN: FileCheck -check-prefix=CHECK-GMLT-WITH-SPLIT < %t %s
58 //
59 // CHECK-GMLT-WITH-SPLIT: "-enable-split-dwarf"
60 // CHECK-GMLT-WITH-SPLIT: "-debug-info-kind=line-tables-only"
61 // CHECK-GMLT-WITH-SPLIT: "-split-dwarf-file"
62 
63 // RUN: %clang -target x86_64-unknown-linux-gnu -g -fno-split-dwarf-inlining -S -### %s 2> %t
64 // RUN: FileCheck -check-prefix=CHECK-NOINLINE-WITHOUT-SPLIT < %t %s
65 //
66 // CHECK-NOINLINE-WITHOUT-SPLIT-NOT: "-enable-split-dwarf"
67 // CHECK-NOINLINE-WITHOUT-SPLIT: "-fno-split-dwarf-inlining"
68 // CHECK-NOINLINE-WITHOUT-SPLIT: "-debug-info-kind=limited"
69 
70 // RUN: %clang -target x86_64-unknown-linux-gnu -gmlt -gsplit-dwarf -fno-split-dwarf-inlining -S -### %s 2> %t
71 // RUN: FileCheck -check-prefix=CHECK-SPLIT-WITH-GMLT < %t %s
72 //
73 // CHECK-SPLIT-WITH-GMLT: "-enable-split-dwarf"
74 // CHECK-SPLIT-WITH-GMLT: "-debug-info-kind=limited"
75 // CHECK-SPLIT-WITH-GMLT: "-split-dwarf-file"
76 
77 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -fno-split-dwarf-inlining -S -### %s 2> %t
78 // RUN: FileCheck -check-prefix=CHECK-SPLIT-WITH-NOINL < %t %s
79 //
80 // CHECK-SPLIT-WITH-NOINL: "-enable-split-dwarf"
81 // CHECK-SPLIT-WITH-NOINL: "-debug-info-kind=limited"
82 // CHECK-SPLIT-WITH-NOINL: "-split-dwarf-file"
83 
84 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -gmlt -S -### %s 2> %t
85 // RUN: FileCheck -check-prefix=CHECK-GMLT-OVER-SPLIT < %t %s
86 //
87 // CHECK-GMLT-OVER-SPLIT-NOT: "-enable-split-dwarf"
88 // CHECK-GMLT-OVER-SPLIT: "-debug-info-kind=line-tables-only"
89 // CHECK-GMLT-OVER-SPLIT-NOT: "-split-dwarf-file"
90 
91 // RUN: %clang -target x86_64-unknown-linux-gnu -gmlt -gsplit-dwarf -S -### %s 2> %t
92 // RUN: FileCheck -check-prefix=CHECK-SPLIT-OVER-GMLT < %t %s
93 //
94 // CHECK-SPLIT-OVER-GMLT: "-enable-split-dwarf" "-debug-info-kind=limited"
95 // CHECK-SPLIT-OVER-GMLT: "-split-dwarf-file"
96 
97 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -g0 -fno-split-dwarf-inlining -S -### %s 2> %t
98 // RUN: FileCheck -check-prefix=CHECK-G0-OVER-SPLIT < %t %s
99 //
100 // CHECK-G0-OVER-SPLIT-NOT: "-enable-split-dwarf"
101 // CHECK-G0-OVER-SPLIT-NOT: "-debug-info-kind
102 // CHECK-G0-OVER-SPLIT-NOT: "-split-dwarf-file"
103 
104 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -g0 -S -### %s 2> %t
105 // RUN: FileCheck -check-prefix=CHECK-G0-OVER-SPLIT < %t %s
106 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=split -g0 -S -### %s 2> %t
107 // RUN: FileCheck -check-prefix=CHECK-G0-OVER-SPLIT < %t %s
108 //
109 // CHECK-G0-OVER-SPLIT-NOT: "-enable-split-dwarf"
110 // CHECK-G0-OVER-SPLIT-NOT: "-debug-info-kind
111 // CHECK-G0-OVER-SPLIT-NOT: "-split-dwarf-file"
112 
113 // RUN: %clang -target x86_64-unknown-linux-gnu -g0 -gsplit-dwarf -S -### %s 2> %t
114 // RUN: FileCheck -check-prefix=CHECK-SPLIT-OVER-G0 < %t %s
115 // RUN: %clang -target x86_64-unknown-linux-gnu -g0 -gsplit-dwarf=split -S -### %s 2> %t
116 // RUN: FileCheck -check-prefix=CHECK-SPLIT-OVER-G0 < %t %s
117 //
118 // CHECK-SPLIT-OVER-G0: "-enable-split-dwarf" "-debug-info-kind=limited"
119 // CHECK-SPLIT-OVER-G0: "-split-dwarf-file"
120