[HIP] Fix ordering of device-libs linking
authorAaron Enye Shi <enye.shi@gmail.com>
Wed, 27 Jun 2018 19:51:42 +0000 (19:51 +0000)
committerAaron Enye Shi <enye.shi@gmail.com>
Wed, 27 Jun 2018 19:51:42 +0000 (19:51 +0000)
commit02151cacca5c99e406da2c2ddaddc8adce432bb6
tree85c0f1fcaa29738aa656f3d51e12efb09fb79386
parent7c57ae57a890126ba646bd97dc94ba00e5e96704
[HIP] Fix ordering of device-libs linking

Summary:
HIP should link the bitcodes with caller functions before callee functions. Also added lit test to check the ordering of the linked bitcodes is matches.

Reviewers: yaxunl, b-sumner

Reviewed By: yaxunl, b-sumner

Subscribers: cfe-commits, yaxunl, b-sumner, scchan

Differential Revision: https://reviews.llvm.org/D48667

llvm-svn: 335774
clang/lib/Driver/ToolChains/HIP.cpp
clang/test/Driver/hip-device-libs.hip