[PATCH] D34448: bug33527 - Linker::LinkOnlyNeeded should import AppendingLinkage globals

Benoit Belley via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 26 17:17:46 PDT 2017


belleyb added inline comments.


================
Comment at: test/Linker/only-needed-compiler-used.ll:8
+
+
+; CHECK-DAG:          @llvm.compiler.used = appending global [2 x i8*] [i8* @used1, i8* bitcast (i32* @used2 to i8*)], section "llvm.metadata"
----------------
The linker emits the references to the global variables in a different ordering when the --only-needed is used. The explains the use of the DAG FileCheck option below.


================
Comment at: test/Linker/only-needed-ctors2.ll:4
+; RUN: llvm-link -S -only-needed -internalize %s %p/Inputs/only-needed-ctors.src.a.ll %p/Inputs/only-needed-ctors.src.b.ll | FileCheck %s --check-prefix=CHECK --check-prefix=INTERNALIZE
+
+; Empty destination module!
----------------
Note that the test case requires at one of the -internalize or - only-needed flag. Else, a link error is generated about `func1` being defined twice. This explains why this particular test case has only 3 runs, instead of 4, like most of the other ones,


================
Comment at: test/Linker/only-needed-ctors4.ll:4
+; RUN: llvm-link -S -only-needed -internalize %s %p/Inputs/only-needed-ctors.src.a.ll %p/Inputs/only-needed-ctors.src.b.ll | FileCheck %s --check-prefix=CHECK --check-prefix=INTERNALIZE
+
+; Destination module:
----------------
Note that the test case requires at one of the -internalize or - only-needed flag. Else, a link error is generated about func1 being defined twice. This explains why this particular test case has only 3 runs, instead of 4, like most of the other ones,


================
Comment at: test/Linker/only-needed-dtors2.ll:4
+; RUN: llvm-link -S -only-needed -internalize %s %p/Inputs/only-needed-dtors.src.a.ll %p/Inputs/only-needed-dtors.src.b.ll | FileCheck %s --check-prefix=CHECK --check-prefix=INTERNALIZE
+
+; Empty destination module!
----------------
Note that the test case requires at one of the -internalize or - only-needed flag. Else, a link error is generated about func1 being defined twice. This explains why this particular test case has only 3 runs, instead of 4, like most of the other ones,


================
Comment at: test/Linker/only-needed-dtors4.ll:4
+; RUN: llvm-link -S -only-needed -internalize %s %p/Inputs/only-needed-dtors.src.a.ll %p/Inputs/only-needed-dtors.src.b.ll | FileCheck %s --check-prefix=CHECK --check-prefix=INTERNALIZE
+
+; Destination module:
----------------
Note that the test case requires at one of the -internalize or - only-needed flag. Else, a link error is generated about func1 being defined twice. This explains why this particular test case has only 3 runs, instead of 4, like most of the other ones,


================
Comment at: test/Linker/only-needed-used.ll:8
+
+
+; CHECK-DAG:          @llvm.used = appending global [2 x i8*] [i8* @used1, i8* bitcast (i32* @used2 to i8*)], section "llvm.metadata"
----------------
The linker emits the references to the global variables in a different ordering when the --only-needed is used. The explains the use of the DAG FileCheck option below.


https://reviews.llvm.org/D34448





More information about the llvm-commits mailing list