summaryrefslogtreecommitdiffstats
path: root/test/Driver/openbsd.c
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2017-02-21 19:11:22 +0000
committerHans Wennborg <hans@hanshq.net>2017-02-21 19:11:22 +0000
commitab74e4bf39c397cf090732a3a5489adc02806fa3 (patch)
tree7713a013b4a3e96a5d2ac6b5611e80e1951377a9 /test/Driver/openbsd.c
parentae27a064af69f173c4b84a5863925f493cdd4bac (diff)
Merging r295610:
------------------------------------------------------------------------ r295610 | brad | 2017-02-19 11:33:26 -0800 (Sun, 19 Feb 2017) | 4 lines Link static PIE programs against rcrt0.o on OpenBSD Patch by Stefan Kempf. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@295752 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Driver/openbsd.c')
-rw-r--r--test/Driver/openbsd.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Driver/openbsd.c b/test/Driver/openbsd.c
index 95b9e6ad4f..587c31ded0 100644
--- a/test/Driver/openbsd.c
+++ b/test/Driver/openbsd.c
@@ -67,3 +67,26 @@
// CHECK-MIPS64-PIC: as{{.*}}" "-mabi" "64" "-EB" "-KPIC"
// CHECK-MIPS64EL: as{{.*}}" "-mabi" "64" "-EL"
// CHECK-MIPS64EL-PIC: as{{.*}}" "-mabi" "64" "-EL" "-KPIC"
+
+// Check linking against correct startup code when (not) using PIE
+// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-PIE %s
+// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -fno-pie %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-PIE %s
+// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -static %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-STATIC-PIE %s
+// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -static -fno-pie %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-STATIC-PIE %s
+// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -nopie %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s
+// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -fno-pie -nopie %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s
+// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -static -nopie %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s
+// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -fno-pie -static -nopie %s -### 2>&1 \
+// RUN: | FileCheck -check-prefix=CHECK-NOPIE %s
+// CHECK-PIE: "{{.*}}crt0.o"
+// CHECK-PIE-NOT: "-nopie"
+// CHECK-STATIC-PIE: "{{.*}}rcrt0.o"
+// CHECK-STATIC-PIE-NOT: "-nopie"
+// CHECK-NOPIE: "-nopie" "{{.*}}crt0.o"