[libc++] Make sure the source file appears before link libraries when compiling tests

Otherwise, files don't link when using a GNU linker, which is more
sensitive on the order of the source file relative to the various
linked libraries. See http://c-faq.com/lib/libsearch.html for an
explanation of the problem.
This commit is contained in:
Louis Dionne 2020-04-07 08:56:30 -04:00
parent cfd388d344
commit 9949cfbd05
2 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@
// appear first in the command-line or not.
// FILE_DEPENDENCIES: %t.exe
// RUN: %{cxx} %{flags} %{compile_flags} %{link_flags} -o %t.exe %s
// RUN: %{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe
// RUN: %{exec} %t.exe 0
// RUN: %{exec} ! %t.exe 1

View File

@ -14,7 +14,7 @@
// - %{exec}
// FILE_DEPENDENCIES: %t.exe
// RUN: %{cxx} %{flags} %{compile_flags} %{link_flags} -o %t.exe %s
// RUN: %{cxx} %s %{flags} %{compile_flags} %{link_flags} -o %t.exe
// RUN: %{exec} %t.exe "HELLO"
#include <cassert>