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" "-split-dwarf-output" "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: "-split-dwarf-file" "split-debug.o"
17 // CHECK-ACTIONS-SINGLE-SPLIT-NOT: "-split-dwarf-output"
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 // CHECK-SINGLE-SPLIT-FILENAME-NOT: "-split-dwarf-output"
24 
25 // RUN: %clang -target x86_64-macosx -gsplit-dwarf -c -### %s 2> %t
26 // RUN: FileCheck -check-prefix=CHECK-NO-ACTIONS < %t %s
27 //
28 // CHECK-NO-ACTIONS-NOT: -split-dwarf
29 
30 
31 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -o Bad.x -### %s 2> %t
32 // RUN: FileCheck -check-prefix=CHECK-BAD < %t %s
33 //
34 // CHECK-BAD-NOT: "Bad.dwo"
35 
36 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -c -### %s 2> %t
37 // RUN: FileCheck -check-prefix=CHECK-OPTION < %t %s
38 //
39 // RUN: %clang -target x86_64-pc-freebsd12 -gsplit-dwarf -c -### %s 2> %t
40 // RUN: FileCheck -check-prefix=CHECK-OPTION < %t %s
41 //
42 // RUN: %clang -target amdgcn-amd-amdhsa -gsplit-dwarf -c -### %s 2> %t
43 // RUN: FileCheck -check-prefix=CHECK-OPTION < %t %s
44 //
45 // CHECK-OPTION: "-split-dwarf-file" "split-debug.dwo" "-split-dwarf-output" "split-debug.dwo"
46 
47 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -S -### %s 2> %t
48 // RUN: FileCheck -check-prefix=CHECK-ASM < %t %s
49 //
50 // CHECK-ASM-NOT: objcopy
51 
52 // RUN: %clang -target x86_64-unknown-linux-gnu -no-integrated-as -gsplit-dwarf -c -### %s 2> %t
53 // RUN: FileCheck -check-prefix=CHECK-IAS < %t %s
54 //
55 // CHECK-IAS: objcopy
56 
57 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -gmlt -fno-split-dwarf-inlining -S -### %s 2> %t
58 // RUN: FileCheck -check-prefix=CHECK-GMLT-WITH-SPLIT < %t %s
59 //
60 // CHECK-GMLT-WITH-SPLIT: "-debug-info-kind=line-tables-only"
61 // CHECK-GMLT-WITH-SPLIT: "-split-dwarf-file"
62 // CHECK-GMLT-WITH-SPLIT: "-split-dwarf-output"
63 
64 // RUN: %clang -target x86_64-unknown-linux-gnu -g -fno-split-dwarf-inlining -S -### %s 2> %t
65 // RUN: FileCheck -check-prefix=CHECK-NOINLINE-WITHOUT-SPLIT < %t %s
66 //
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: "-debug-info-kind=limited"
74 // CHECK-SPLIT-WITH-GMLT: "-split-dwarf-output"
75 
76 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -fno-split-dwarf-inlining -S -### %s 2> %t
77 // RUN: FileCheck -check-prefix=CHECK-SPLIT-WITH-NOINL < %t %s
78 //
79 // CHECK-SPLIT-WITH-NOINL: "-debug-info-kind=limited"
80 // CHECK-SPLIT-WITH-NOINL: "-split-dwarf-output"
81 
82 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -gmlt -S -### %s 2> %t
83 // RUN: FileCheck -check-prefix=CHECK-GMLT-OVER-SPLIT < %t %s
84 //
85 // CHECK-GMLT-OVER-SPLIT: "-debug-info-kind=line-tables-only"
86 // CHECK-GMLT-OVER-SPLIT-NOT: "-split-dwarf-file"
87 // CHECK-GMLT-OVER-SPLIT-NOT: "-split-dwarf-output"
88 
89 // RUN: %clang -target x86_64-unknown-linux-gnu -gmlt -gsplit-dwarf -S -### %s 2> %t
90 // RUN: FileCheck -check-prefix=CHECK-SPLIT-OVER-GMLT < %t %s
91 //
92 // CHECK-SPLIT-OVER-GMLT: "-debug-info-kind=limited"
93 // CHECK-SPLIT-OVER-GMLT: "-split-dwarf-file"
94 // CHECK-SPLIT-OVER-GMLT: "-split-dwarf-output"
95 
96 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -g0 -fno-split-dwarf-inlining -S -### %s 2> %t
97 // RUN: FileCheck -check-prefix=CHECK-G0-OVER-SPLIT < %t %s
98 //
99 // CHECK-G0-OVER-SPLIT-NOT: "-debug-info-kind
100 // CHECK-G0-OVER-SPLIT-NOT: "-split-dwarf-file"
101 // CHECK-G0-OVER-SPLIT-NOT: "-split-dwarf-output"
102 
103 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf -g0 -S -### %s 2> %t
104 // RUN: FileCheck -check-prefix=CHECK-G0-OVER-SPLIT < %t %s
105 // RUN: %clang -target x86_64-unknown-linux-gnu -gsplit-dwarf=split -g0 -S -### %s 2> %t
106 // RUN: FileCheck -check-prefix=CHECK-G0-OVER-SPLIT < %t %s
107 //
108 // CHECK-G0-OVER-SPLIT-NOT: "-debug-info-kind
109 // CHECK-G0-OVER-SPLIT-NOT: "-split-dwarf-file"
110 // CHECK-G0-OVER-SPLIT-NOT: "-split-dwarf-output"
111 
112 // RUN: %clang -target x86_64-unknown-linux-gnu -g0 -gsplit-dwarf -S -### %s 2> %t
113 // RUN: FileCheck -check-prefix=CHECK-SPLIT-OVER-G0 < %t %s
114 // RUN: %clang -target x86_64-unknown-linux-gnu -g0 -gsplit-dwarf=split -S -### %s 2> %t
115 // RUN: FileCheck -check-prefix=CHECK-SPLIT-OVER-G0 < %t %s
116 //
117 // CHECK-SPLIT-OVER-G0: "-debug-info-kind=limited"
118 // CHECK-SPLIT-OVER-G0: "-split-dwarf-file"
119 // CHECK-SPLIT-OVER-G0: "-split-dwarf-output"
120