aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-02-23 19:02:12 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-02-23 19:02:12 +0000
commit1b6fff624e24727940c1fe59431e74ef11eda230 (patch)
treef2276a59448bc627bc84546660602d31cfa0793e /test
parenteb2854521a26d3f186018f1b119761ca7bb90dc2 (diff)
downloadsrc-1b6fff624e24727940c1fe59431e74ef11eda230.tar.gz
src-1b6fff624e24727940c1fe59431e74ef11eda230.zip
Vendor import of clang release_40 branch r295910:vendor/clang/clang-release_40-r295910
Notes
Notes: svn path=/vendor/clang/dist/; revision=314161 svn path=/vendor/clang/clang-release_40-r295910/; revision=314162; tag=vendor/clang/clang-release_40-r295910
Diffstat (limited to 'test')
-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 95b9e6ad4f36..587c31ded0a7 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"