blob: 09451a81b797d2467a6717a5e852e056ade90cc7 [file] [log] [blame]
Daniel Dunbar6beaf512010-06-04 18:28:41 +00001// Check that we run dsymutil properly with multiple -arch options.
2//
Sebastian Pop422377c2012-01-20 22:01:23 +00003// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-phases \
Daniel Dunbar6beaf512010-06-04 18:28:41 +00004// 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
Bob Wilson23a55f12014-12-21 07:00:00 +00009// CHECK-MULTIARCH-ACTIONS: 2: compiler, {1}, ir
10// CHECK-MULTIARCH-ACTIONS: 3: backend, {2}, assembler
11// CHECK-MULTIARCH-ACTIONS: 4: assembler, {3}, object
12// CHECK-MULTIARCH-ACTIONS: 5: linker, {4}, image
13// CHECK-MULTIARCH-ACTIONS: 6: bind-arch, "i386", {5}, image
14// CHECK-MULTIARCH-ACTIONS: 7: bind-arch, "x86_64", {5}, image
15// CHECK-MULTIARCH-ACTIONS: 8: lipo, {6, 7}, image
16// CHECK-MULTIARCH-ACTIONS: 9: dsymutil, {8}, dSYM
Daniel Dunbar6beaf512010-06-04 18:28:41 +000017//
Sebastian Pop422377c2012-01-20 22:01:23 +000018// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
Daniel Dunbar6beaf512010-06-04 18:28:41 +000019// RUN: -arch i386 -arch x86_64 %s -g 2> %t
20// RUN: FileCheck -check-prefix=CHECK-MULTIARCH-BINDINGS < %t %s
21//
22// CHECK-MULTIARCH-BINDINGS: "x86_64-apple-darwin10" - "darwin::Lipo", inputs: [{{.*}}, {{.*}}], output: "a.out"
Daniel Dunbar223749d2010-07-01 01:36:31 +000023// CHECK-MULTIARCH-BINDINGS: # "x86_64-apple-darwin10" - "darwin::Dsymutil", inputs: ["a.out"], output: "a.out.dSYM"
Daniel Dunbar6beaf512010-06-04 18:28:41 +000024
25// Check output name derivation.
26//
Sebastian Pop422377c2012-01-20 22:01:23 +000027// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
Daniel Dunbar6beaf512010-06-04 18:28:41 +000028// RUN: -o foo %s -g 2> %t
29// RUN: FileCheck -check-prefix=CHECK-OUTPUT-NAME < %t %s
30//
Douglas Katzman95354292015-06-23 20:42:09 +000031// CHECK-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::Linker", inputs: [{{.*}}], output: "foo"
Daniel Dunbar6beaf512010-06-04 18:28:41 +000032// CHECK-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::Dsymutil", inputs: ["foo"], output: "foo.dSYM"
Daniel Dunbar00d3d8e2010-06-29 16:38:33 +000033
34// Check that we only use dsymutil when needed.
35//
36// RUN: touch %t.o
Sebastian Pop422377c2012-01-20 22:01:23 +000037// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
Daniel Dunbar00d3d8e2010-06-29 16:38:33 +000038// RUN: -o foo %t.o -g 2> %t
Rafael Espindolabe8a91b2013-07-04 15:22:16 +000039// RUN: not grep "Dsymutil" %t
Daniel Dunbar67fea712011-03-25 18:16:51 +000040
41// Check that we put the .dSYM in the right place.
Sebastian Pop422377c2012-01-20 22:01:23 +000042// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
Daniel Dunbar67fea712011-03-25 18:16:51 +000043// RUN: -o bar/foo %s -g 2> %t
44// RUN: FileCheck -check-prefix=CHECK-LOCATION < %t %s
45
46// CHECK-LOCATION: "x86_64-apple-darwin10" - "darwin::Dsymutil", inputs: ["bar/foo"], output: "bar/foo.dSYM"
Bob Wilsonf8cf1612014-02-21 00:20:07 +000047
48// Check that we don't crash when translating arguments for dsymutil.
49// RUN: %clang -m32 -arch x86_64 -g %s -###