2012-10-10 04:46:28 +08:00
|
|
|
// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -### 2>&1 \
|
2012-09-13 14:32:34 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LD %s
|
|
|
|
// CHECK-LD: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
|
2018-10-12 00:13:44 +08:00
|
|
|
// CHECK-LD: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lcompiler_rt" "-lc" "-lcompiler_rt" "{{.*}}crtend.o"
|
2009-06-30 04:52:51 +08:00
|
|
|
|
2017-02-20 04:11:48 +08:00
|
|
|
// Check for --eh-frame-hdr being passed with static linking
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -static %s -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LD-STATIC-EH %s
|
|
|
|
// CHECK-LD-STATIC-EH: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
|
2018-10-12 00:13:44 +08:00
|
|
|
// CHECK-LD-STATIC-EH: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bstatic" "-o" "a.out" "{{.*}}rcrt0.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lcompiler_rt" "-lc" "-lcompiler_rt" "{{.*}}crtend.o"
|
2017-02-20 04:11:48 +08:00
|
|
|
|
2012-10-10 04:46:28 +08:00
|
|
|
// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -pg -pthread %s -### 2>&1 \
|
2012-09-13 14:32:34 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-PG %s
|
|
|
|
// CHECK-PG: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
|
2018-10-28 11:30:18 +08:00
|
|
|
// CHECK-PG: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-nopie" "-o" "a.out" "{{.*}}gcrt0.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lcompiler_rt" "-lpthread_p" "-lc_p" "-lcompiler_rt" "{{.*}}crtend.o"
|
2013-01-01 06:41:36 +08:00
|
|
|
|
2015-01-06 10:53:17 +08:00
|
|
|
// Check CPU type for MIPS64
|
|
|
|
// RUN: %clang -target mips64-unknown-openbsd -### -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-MIPS64-CPU %s
|
|
|
|
// RUN: %clang -target mips64el-unknown-openbsd -### -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-MIPS64EL-CPU %s
|
|
|
|
// CHECK-MIPS64-CPU: "-target-cpu" "mips3"
|
|
|
|
// CHECK-MIPS64EL-CPU: "-target-cpu" "mips3"
|
|
|
|
|
2013-01-01 06:41:36 +08:00
|
|
|
// Check that the new linker flags are passed to OpenBSD
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -r %s -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LD-R %s
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -s %s -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LD-S %s
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -t %s -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LD-T %s
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -Z %s -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LD-Z %s
|
2013-12-07 08:57:46 +08:00
|
|
|
// RUN: %clang -no-canonical-prefixes -target mips64-unknown-openbsd %s -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-MIPS64-LD %s
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target mips64el-unknown-openbsd %s -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-LD %s
|
2013-01-01 06:41:36 +08:00
|
|
|
// CHECK-LD-R: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
|
2018-10-12 00:13:44 +08:00
|
|
|
// CHECK-LD-R: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-r" "{{.*}}.o" "-lcompiler_rt" "-lc" "-lcompiler_rt" "{{.*}}crtend.o"
|
2013-01-01 06:41:36 +08:00
|
|
|
// CHECK-LD-S: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
|
2018-10-12 00:13:44 +08:00
|
|
|
// CHECK-LD-S: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-s" "{{.*}}.o" "-lcompiler_rt" "-lc" "-lcompiler_rt" "{{.*}}crtend.o"
|
2013-01-01 06:41:36 +08:00
|
|
|
// CHECK-LD-T: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
|
2018-10-12 00:13:44 +08:00
|
|
|
// CHECK-LD-T: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-t" "{{.*}}.o" "-lcompiler_rt" "-lc" "-lcompiler_rt" "{{.*}}crtend.o"
|
2013-01-01 06:41:36 +08:00
|
|
|
// CHECK-LD-Z: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
|
2018-10-12 00:13:44 +08:00
|
|
|
// CHECK-LD-Z: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-Z" "{{.*}}.o" "-lcompiler_rt" "-lc" "-lcompiler_rt" "{{.*}}crtend.o"
|
2013-12-07 08:57:46 +08:00
|
|
|
// CHECK-MIPS64-LD: clang{{.*}}" "-cc1" "-triple" "mips64-unknown-openbsd"
|
2018-10-12 00:13:44 +08:00
|
|
|
// CHECK-MIPS64-LD: ld{{.*}}" "-EB" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "{{.*}}.o" "-lcompiler_rt" "-lc" "-lcompiler_rt" "{{.*}}crtend.o"
|
2013-12-07 08:57:46 +08:00
|
|
|
// CHECK-MIPS64EL-LD: clang{{.*}}" "-cc1" "-triple" "mips64el-unknown-openbsd"
|
2018-10-12 00:13:44 +08:00
|
|
|
// CHECK-MIPS64EL-LD: ld{{.*}}" "-EL" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "{{.*}}.o" "-lcompiler_rt" "-lc" "-lcompiler_rt" "{{.*}}crtend.o"
|
2013-12-07 08:57:46 +08:00
|
|
|
|
|
|
|
// Check passing options to the assembler for various OpenBSD targets
|
|
|
|
// RUN: %clang -target amd64-pc-openbsd -m32 -### -no-integrated-as -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-AMD64-M32 %s
|
|
|
|
// RUN: %clang -target powerpc-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-POWERPC %s
|
2014-02-28 09:55:21 +08:00
|
|
|
// RUN: %clang -target sparc-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-SPARC %s
|
|
|
|
// RUN: %clang -target sparc64-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-SPARC64 %s
|
2013-12-07 08:57:46 +08:00
|
|
|
// RUN: %clang -target mips64-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-MIPS64 %s
|
|
|
|
// RUN: %clang -target mips64-unknown-openbsd -fPIC -### -no-integrated-as -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-MIPS64-PIC %s
|
|
|
|
// RUN: %clang -target mips64el-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-MIPS64EL %s
|
|
|
|
// RUN: %clang -target mips64el-unknown-openbsd -fPIC -### -no-integrated-as -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-MIPS64EL-PIC %s
|
|
|
|
// CHECK-AMD64-M32: as{{.*}}" "--32"
|
|
|
|
// CHECK-POWERPC: as{{.*}}" "-mppc" "-many"
|
2015-11-10 08:40:29 +08:00
|
|
|
// CHECK-SPARC: as{{.*}}" "-32" "-Av8"
|
|
|
|
// CHECK-SPARC64: as{{.*}}" "-64" "-Av9"
|
2013-12-07 08:57:46 +08:00
|
|
|
// CHECK-MIPS64: as{{.*}}" "-mabi" "64" "-EB"
|
|
|
|
// CHECK-MIPS64-PIC: as{{.*}}" "-mabi" "64" "-EB" "-KPIC"
|
|
|
|
// CHECK-MIPS64EL: as{{.*}}" "-mabi" "64" "-EL"
|
|
|
|
// CHECK-MIPS64EL-PIC: as{{.*}}" "-mabi" "64" "-EL" "-KPIC"
|
2017-02-20 03:33:26 +08:00
|
|
|
|
2019-01-16 05:04:36 +08:00
|
|
|
// Check that the integrated assembler is enabled for MIPS64/SPARC
|
2018-06-30 03:03:03 +08:00
|
|
|
// RUN: %clang -target mips64-unknown-openbsd -### -c %s 2>&1 \
|
2019-01-16 05:04:36 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-IAS %s
|
2018-06-30 03:03:03 +08:00
|
|
|
// RUN: %clang -target mips64el-unknown-openbsd -### -c %s 2>&1 \
|
2019-01-16 05:04:36 +08:00
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-IAS %s
|
|
|
|
// RUN: %clang -target sparc-unknown-openbsd -### -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-IAS %s
|
|
|
|
// RUN: %clang -target sparc64-unknown-openbsd -### -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-IAS %s
|
|
|
|
// CHECK-IAS-NOT: "-no-integrated-as"
|
2018-06-30 03:03:03 +08:00
|
|
|
|
2017-02-20 03:33:26 +08:00
|
|
|
// 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
|
2017-07-31 05:13:59 +08:00
|
|
|
// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -pie %s -### 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-PIE-FLAG %s
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -fno-pie %s -### 2>&1 \
|
2017-02-20 03:33:26 +08:00
|
|
|
// 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"
|
2017-07-31 05:13:59 +08:00
|
|
|
// CHECK-PIE-FLAG: "-pie"
|
2017-02-20 03:33:26 +08:00
|
|
|
// CHECK-STATIC-PIE: "{{.*}}rcrt0.o"
|
|
|
|
// CHECK-STATIC-PIE-NOT: "-nopie"
|
|
|
|
// CHECK-NOPIE: "-nopie" "{{.*}}crt0.o"
|
2017-02-28 11:20:26 +08:00
|
|
|
|
|
|
|
// Check ARM float ABI
|
|
|
|
// RUN: %clang -target arm-unknown-openbsd -### -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-ARM-FLOAT-ABI %s
|
2018-07-23 06:04:28 +08:00
|
|
|
// CHECK-ARM-FLOAT-ABI-NOT: "-target-feature" "+soft-float"
|
|
|
|
// CHECK-ARM-FLOAT-ABI: "-target-feature" "+soft-float-abi"
|
2018-11-19 08:21:06 +08:00
|
|
|
|
|
|
|
// Check PowerPC for Secure PLT
|
|
|
|
// RUN: %clang -target powerpc-unknown-openbsd -### -c %s 2>&1 \
|
|
|
|
// RUN: | FileCheck -check-prefix=CHECK-POWERPC-SECUREPLT %s
|
|
|
|
// CHECK-POWERPC-SECUREPLT: "-target-feature" "+secure-plt"
|