1 // Check that we run dsymutil properly with multiple -arch options.
2 //
3 // RUN: %clang -target x86_64-apple-darwin10 -ccc-print-phases \
4 // RUN:   -arch i386 -arch x86_64 %s -g 2> %t
5 // RUN: FileCheck -check-prefix=CHECK-MULTIARCH-ACTIONS < %t %s
6 //
7 // CHECK-MULTIARCH-ACTIONS: 0: input, "{{.*}}darwin-dsymutil.c", c
8 // CHECK-MULTIARCH-ACTIONS: 1: preprocessor, {0}, cpp-output
9 // CHECK-MULTIARCH-ACTIONS: 2: compiler, {1}, assembler
10 // CHECK-MULTIARCH-ACTIONS: 3: assembler, {2}, object
11 // CHECK-MULTIARCH-ACTIONS: 4: linker, {3}, image
12 // CHECK-MULTIARCH-ACTIONS: 5: bind-arch, "i386", {4}, image
13 // CHECK-MULTIARCH-ACTIONS: 6: bind-arch, "x86_64", {4}, image
14 // CHECK-MULTIARCH-ACTIONS: 7: lipo, {5, 6}, image
15 // CHECK-MULTIARCH-ACTIONS: 8: dsymutil, {7}, dSYM
16 //
17 // RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
18 // RUN:   -arch i386 -arch x86_64 %s -g 2> %t
19 // RUN: FileCheck -check-prefix=CHECK-MULTIARCH-BINDINGS < %t %s
20 //
21 // CHECK-MULTIARCH-BINDINGS: "x86_64-apple-darwin10" - "darwin::Lipo", inputs: [{{.*}}, {{.*}}], output: "a.out"
22 // CHECK-MULTIARCH-BINDINGS: # "x86_64-apple-darwin10" - "darwin::Dsymutil", inputs: ["a.out"], output: "a.out.dSYM"
23 
24 // Check output name derivation.
25 //
26 // RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
27 // RUN:   -o foo %s -g 2> %t
28 // RUN: FileCheck -check-prefix=CHECK-OUTPUT-NAME < %t %s
29 //
30 // CHECK-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::Link", inputs: [{{.*}}], output: "foo"
31 // CHECK-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::Dsymutil", inputs: ["foo"], output: "foo.dSYM"
32 
33 // Check that we only use dsymutil when needed.
34 //
35 // RUN: touch %t.o
36 // RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
37 // RUN:   -o foo %t.o -g 2> %t
38 // RUN: not grep "Dsymutil" %t
39 
40 // Check that we put the .dSYM in the right place.
41 // RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
42 // RUN:   -o bar/foo %s -g 2> %t
43 // RUN: FileCheck -check-prefix=CHECK-LOCATION < %t %s
44 
45 // CHECK-LOCATION: "x86_64-apple-darwin10" - "darwin::Dsymutil", inputs: ["bar/foo"], output: "bar/foo.dSYM"
46