summaryrefslogtreecommitdiffstats
path: root/clang/test/InterfaceStubs
diff options
context:
space:
mode:
authorPuyan Lotfi <puyan@puyan.org>2019-11-16 11:41:01 -0500
committerPuyan Lotfi <puyan@puyan.org>2019-11-19 01:18:02 -0500
commit58ea00b51fe9b011301484957556872fced7dd08 (patch)
tree9883c89598370baa140659b04ef5aa43123e6ab2 /clang/test/InterfaceStubs
parentb337bce8710f2a7ab8ce9f84c80cfbce1032963c (diff)
downloadbcm5719-llvm-58ea00b51fe9b011301484957556872fced7dd08.tar.gz
bcm5719-llvm-58ea00b51fe9b011301484957556872fced7dd08.zip
[clang][IFS] Driver pipeline: generate interface stubs after standard pipeline.
Up until now, clang interface stubs has replaced the standard PP -> C -> BE -> ASM -> LNK pipeline. With this change, it will happen in conjunction with it. So what when you build your code you will get an a.out or lib.so as well as an interface stub file. Example: clang -shared -o libfoo.so -emit-interface-stubs ... will generate both a libfoo.so and a libfoo.ifso. The .so file will contain the code from the standard compilation pipeline and the .ifso file will contain the ELF stub library. Differential Revision: https://reviews.llvm.org/D70274
Diffstat (limited to 'clang/test/InterfaceStubs')
-rw-r--r--clang/test/InterfaceStubs/driver-test.c14
-rw-r--r--clang/test/InterfaceStubs/driver-test2.c14
-rw-r--r--clang/test/InterfaceStubs/windows.cpp3
3 files changed, 24 insertions, 7 deletions
diff --git a/clang/test/InterfaceStubs/driver-test.c b/clang/test/InterfaceStubs/driver-test.c
index d4e50295411..bb2868f6df0 100644
--- a/clang/test/InterfaceStubs/driver-test.c
+++ b/clang/test/InterfaceStubs/driver-test.c
@@ -1,11 +1,13 @@
// REQUIRES: x86-registered-target
-// RUN: %clang -target x86_64-unknown-linux-gnu -x c -o %t1.so -emit-interface-stubs %s %S/object.c %S/weak.cpp && \
-// RUN: llvm-nm %t1.so 2>&1 | FileCheck --check-prefix=CHECK-IFS %s
+// RUN: %clang -target x86_64-unknown-linux-gnu -x c -o %t1 -emit-interface-stubs %s %S/object.c %S/weak.cpp
+// RUN: llvm-nm %t1 2>&1 | FileCheck %s
+// RUN: llvm-nm %t1.ifso 2>&1 | FileCheck %s
-// CHECK-IFS-DAG: data
-// CHECK-IFS-DAG: foo
-// CHECK-IFS-DAG: strongFunc
-// CHECK-IFS-DAG: weakFunc
+// CHECK-DAG: data
+// CHECK-DAG: foo
+// CHECK-DAG: strongFunc
+// CHECK-DAG: weakFunc
int foo(int bar) { return 42 + 1844; }
+int main() { return foo(23); }
diff --git a/clang/test/InterfaceStubs/driver-test2.c b/clang/test/InterfaceStubs/driver-test2.c
new file mode 100644
index 00000000000..f0f889a799d
--- /dev/null
+++ b/clang/test/InterfaceStubs/driver-test2.c
@@ -0,0 +1,14 @@
+// REQUIRES: x86-registered-target
+
+// RUN: %clang -target x86_64-unknown-linux-gnu -c -emit-interface-stubs \
+// RUN: %s %S/object.c %S/weak.cpp
+// RUN: %clang -emit-interface-stubs -emit-merged-ifs \
+// RUN: driver-test2.o object.o weak.o -S -o - | FileCheck %s
+
+// CHECK-DAG: data
+// CHECK-DAG: bar
+// CHECK-DAG: strongFunc
+// CHECK-DAG: weakFunc
+
+int bar(int a) { return a; }
+int main() { return 0; }
diff --git a/clang/test/InterfaceStubs/windows.cpp b/clang/test/InterfaceStubs/windows.cpp
index 9ccb771a2f3..c81c702861e 100644
--- a/clang/test/InterfaceStubs/windows.cpp
+++ b/clang/test/InterfaceStubs/windows.cpp
@@ -1,6 +1,7 @@
// REQUIRES: x86-registered-target
// RUN: %clang_cc1 -triple x86_64-windows-msvc -o - %s -emit-interface-stubs | FileCheck -check-prefix=CHECK-CC1 %s
-// RUN: %clang -target x86_64-windows-msvc -o - %s -emit-interface-stubs -emit-merged-ifs | FileCheck -check-prefix=CHECK-IFS %s
+// RUN: %clang -target x86_64-windows-msvc -o - %s -emit-interface-stubs -emit-merged-ifs -S | FileCheck -check-prefix=CHECK-IFS %s
+// note: -S is added here to prevent clang from invoking link.exe
// CHECK-CC1: Symbols:
// CHECK-CC1-NEXT: ?helloWindowsMsvc@@YAHXZ
OpenPOWER on IntegriCloud