2010-06-05 02:28:41 +08:00
|
|
|
// Check that we run dsymutil properly with multiple -arch options.
|
|
|
|
//
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-phases \
|
2010-06-05 02:28:41 +08:00
|
|
|
// RUN: -arch i386 -arch x86_64 %s -g 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-MULTIARCH-ACTIONS < %t %s
|
|
|
|
//
|
|
|
|
// CHECK-MULTIARCH-ACTIONS: 0: input, "{{.*}}darwin-dsymutil.c", c
|
|
|
|
// CHECK-MULTIARCH-ACTIONS: 1: preprocessor, {0}, cpp-output
|
Reapply "Change -save-temps to emit unoptimized bitcode files."
This reapplies r224503 along with a fix for compiling Fortran by having the
clang driver invoke gcc (see r224546, where it was reverted). I have added
a testcase for that as well.
Original commit message:
It is often convenient to use -save-temps to collect the intermediate
results of a compilation, e.g., when triaging a bug report. Besides the
temporary files for preprocessed source and assembly code, this adds the
unoptimized bitcode files as well.
This adds a new BackendJobAction, which is mostly mechanical, to run after
the CompileJobAction. When not using -save-temps, the BackendJobAction is
combined into one job with the CompileJobAction, similar to the way the
integrated assembler is handled. I've implemented this entirely as a
driver change, so under the hood, it is just using -disable-llvm-optzns
to get the unoptimized bitcode.
Based in part on a patch by Steven Wu.
rdar://problem/18909437
llvm-svn: 224688
2014-12-21 15:00:00 +08:00
|
|
|
// CHECK-MULTIARCH-ACTIONS: 2: compiler, {1}, ir
|
|
|
|
// CHECK-MULTIARCH-ACTIONS: 3: backend, {2}, assembler
|
|
|
|
// CHECK-MULTIARCH-ACTIONS: 4: assembler, {3}, object
|
|
|
|
// CHECK-MULTIARCH-ACTIONS: 5: linker, {4}, image
|
|
|
|
// CHECK-MULTIARCH-ACTIONS: 6: bind-arch, "i386", {5}, image
|
|
|
|
// CHECK-MULTIARCH-ACTIONS: 7: bind-arch, "x86_64", {5}, image
|
|
|
|
// CHECK-MULTIARCH-ACTIONS: 8: lipo, {6, 7}, image
|
|
|
|
// CHECK-MULTIARCH-ACTIONS: 9: dsymutil, {8}, dSYM
|
2010-06-05 02:28:41 +08:00
|
|
|
//
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
|
2010-06-05 02:28:41 +08:00
|
|
|
// RUN: -arch i386 -arch x86_64 %s -g 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-MULTIARCH-BINDINGS < %t %s
|
|
|
|
//
|
|
|
|
// CHECK-MULTIARCH-BINDINGS: "x86_64-apple-darwin10" - "darwin::Lipo", inputs: [{{.*}}, {{.*}}], output: "a.out"
|
2010-07-01 09:36:31 +08:00
|
|
|
// CHECK-MULTIARCH-BINDINGS: # "x86_64-apple-darwin10" - "darwin::Dsymutil", inputs: ["a.out"], output: "a.out.dSYM"
|
2010-06-05 02:28:41 +08:00
|
|
|
|
|
|
|
// Check output name derivation.
|
|
|
|
//
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
|
2010-06-05 02:28:41 +08:00
|
|
|
// RUN: -o foo %s -g 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-OUTPUT-NAME < %t %s
|
|
|
|
//
|
2015-06-24 04:42:09 +08:00
|
|
|
// CHECK-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::Linker", inputs: [{{.*}}], output: "foo"
|
2010-06-05 02:28:41 +08:00
|
|
|
// CHECK-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::Dsymutil", inputs: ["foo"], output: "foo.dSYM"
|
2010-06-30 00:38:33 +08:00
|
|
|
|
|
|
|
// Check that we only use dsymutil when needed.
|
|
|
|
//
|
|
|
|
// RUN: touch %t.o
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
|
2010-06-30 00:38:33 +08:00
|
|
|
// RUN: -o foo %t.o -g 2> %t
|
2013-07-04 23:22:16 +08:00
|
|
|
// RUN: not grep "Dsymutil" %t
|
2011-03-26 02:16:51 +08:00
|
|
|
|
|
|
|
// Check that we put the .dSYM in the right place.
|
2012-01-21 06:01:23 +08:00
|
|
|
// RUN: %clang -target x86_64-apple-darwin10 -ccc-print-bindings \
|
2011-03-26 02:16:51 +08:00
|
|
|
// RUN: -o bar/foo %s -g 2> %t
|
|
|
|
// RUN: FileCheck -check-prefix=CHECK-LOCATION < %t %s
|
|
|
|
|
|
|
|
// CHECK-LOCATION: "x86_64-apple-darwin10" - "darwin::Dsymutil", inputs: ["bar/foo"], output: "bar/foo.dSYM"
|
2014-02-21 08:20:07 +08:00
|
|
|
|
|
|
|
// Check that we don't crash when translating arguments for dsymutil.
|
|
|
|
// RUN: %clang -m32 -arch x86_64 -g %s -###
|