[Linker] Remove warning when linking ARM and Thumb IR modules.
Summary:
This patch updates Triple::isCompatibleWith to make armxx and thumbxx
triples compatible, as long as the subarch, vendor, os, envorionment and
object format match. Thumb/ARM code generation should be controlled
using the thumb-mode per-function target feature rather than by the
triple to allow mixing Thumb and ARM functions.
D33448 updates Clang's codegen to add thumb-mode for all functions with
armxx or thumbxx triples.
Reviewers: echristo, t.p.northover, rafael, kristof.beyls, rengolin, tejohnson
Reviewed By: tejohnson
Subscribers: rinon, eugenis, pcc, srhines, aemerson, mehdi_amini, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D33287
llvm-svn: 304884
2017-06-07 17:17:01 +08:00
|
|
|
; RUN: llvm-as %s -o %t1.bc
|
|
|
|
; RUN: llvm-as %p/Inputs/thumb.ll -o %t2.bc
|
2017-06-07 17:59:22 +08:00
|
|
|
; RUN: llvm-link %t1.bc %t2.bc -S 2> %t3.out | FileCheck %s
|
[Linker] Remove warning when linking ARM and Thumb IR modules.
Summary:
This patch updates Triple::isCompatibleWith to make armxx and thumbxx
triples compatible, as long as the subarch, vendor, os, envorionment and
object format match. Thumb/ARM code generation should be controlled
using the thumb-mode per-function target feature rather than by the
triple to allow mixing Thumb and ARM functions.
D33448 updates Clang's codegen to add thumb-mode for all functions with
armxx or thumbxx triples.
Reviewers: echristo, t.p.northover, rafael, kristof.beyls, rengolin, tejohnson
Reviewed By: tejohnson
Subscribers: rinon, eugenis, pcc, srhines, aemerson, mehdi_amini, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D33287
llvm-svn: 304884
2017-06-07 17:17:01 +08:00
|
|
|
; RUN: FileCheck --allow-empty --input-file %t3.out --check-prefix STDERR %s
|
|
|
|
|
|
|
|
target triple = "armv7-linux-gnueabihf"
|
|
|
|
|
|
|
|
declare i32 @foo(i32 %a, i32 %b);
|
|
|
|
|
|
|
|
define i32 @main() {
|
|
|
|
entry:
|
|
|
|
%add = call i32 @foo(i32 10, i32 20)
|
|
|
|
ret i32 %add
|
|
|
|
}
|
|
|
|
|
2017-06-07 17:59:22 +08:00
|
|
|
; CHECK: define i32 @main() {
|
|
|
|
; CHECK: define i32 @foo(i32 %a, i32 %b) [[ARM_ATTRS:#[0-9]+]]
|
|
|
|
; CHECK: define i32 @bar(i32 %a, i32 %b) [[THUMB_ATTRS:#[0-9]+]]
|
[Linker] Remove warning when linking ARM and Thumb IR modules.
Summary:
This patch updates Triple::isCompatibleWith to make armxx and thumbxx
triples compatible, as long as the subarch, vendor, os, envorionment and
object format match. Thumb/ARM code generation should be controlled
using the thumb-mode per-function target feature rather than by the
triple to allow mixing Thumb and ARM functions.
D33448 updates Clang's codegen to add thumb-mode for all functions with
armxx or thumbxx triples.
Reviewers: echristo, t.p.northover, rafael, kristof.beyls, rengolin, tejohnson
Reviewed By: tejohnson
Subscribers: rinon, eugenis, pcc, srhines, aemerson, mehdi_amini, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D33287
llvm-svn: 304884
2017-06-07 17:17:01 +08:00
|
|
|
|
2017-06-07 17:59:22 +08:00
|
|
|
; CHECK: attributes [[ARM_ATTRS]] = { "target-features"="-thumb-mode" }
|
|
|
|
; CHECK: attributes [[THUMB_ATTRS]] = { "target-features"="+thumb-mode" }
|
[Linker] Remove warning when linking ARM and Thumb IR modules.
Summary:
This patch updates Triple::isCompatibleWith to make armxx and thumbxx
triples compatible, as long as the subarch, vendor, os, envorionment and
object format match. Thumb/ARM code generation should be controlled
using the thumb-mode per-function target feature rather than by the
triple to allow mixing Thumb and ARM functions.
D33448 updates Clang's codegen to add thumb-mode for all functions with
armxx or thumbxx triples.
Reviewers: echristo, t.p.northover, rafael, kristof.beyls, rengolin, tejohnson
Reviewed By: tejohnson
Subscribers: rinon, eugenis, pcc, srhines, aemerson, mehdi_amini, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D33287
llvm-svn: 304884
2017-06-07 17:17:01 +08:00
|
|
|
|
|
|
|
; STDERR-NOT: warning: Linking two modules of different target triples:
|