2012-10-10 04:46:28 +08:00
|
|
|
// RUN: %clang -no-canonical-prefixes \
|
2014-11-14 00:55:42 +08:00
|
|
|
// RUN: -target aarch64-pc-freebsd11 %s \
|
|
|
|
// RUN: --sysroot=%S/Inputs/basic_freebsd64_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-ARM64 %s
|
|
|
|
// CHECK-ARM64: "-cc1" "-triple" "aarch64-pc-freebsd11"
|
|
|
|
// CHECK-ARM64: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
|
|
|
// CHECK-ARM64: "--eh-frame-hdr" "-dynamic-linker" "{{.*}}ld-elf{{.*}}" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "-L[[SYSROOT]]/usr/lib" "{{.*}}.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "{{.*}}crtend.o" "{{.*}}crtn.o"
|
|
|
|
//
|
|
|
|
// RUN: %clang -no-canonical-prefixes \
|
2012-04-10 04:40:11 +08:00
|
|
|
// RUN: -target powerpc-pc-freebsd8 %s \
|
2012-01-26 09:35:15 +08:00
|
|
|
// RUN: --sysroot=%S/Inputs/basic_freebsd_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-PPC %s
|
2014-06-27 19:18:13 +08:00
|
|
|
// CHECK-PPC: "-cc1" "-triple" "powerpc-pc-freebsd8"
|
2012-01-25 18:50:34 +08:00
|
|
|
// CHECK-PPC: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
|
|
|
// CHECK-PPC: "--eh-frame-hdr" "-dynamic-linker" "{{.*}}ld-elf{{.*}}" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "-L[[SYSROOT]]/usr/lib" "{{.*}}.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "{{.*}}crtend.o" "{{.*}}crtn.o"
|
2010-08-11 01:39:05 +08:00
|
|
|
//
|
2012-10-10 04:46:28 +08:00
|
|
|
// RUN: %clang -no-canonical-prefixes \
|
2012-04-10 04:40:11 +08:00
|
|
|
// RUN: -target powerpc64-pc-freebsd8 %s \
|
2012-01-26 09:35:15 +08:00
|
|
|
// RUN: --sysroot=%S/Inputs/basic_freebsd64_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-PPC64 %s
|
2014-06-27 19:18:13 +08:00
|
|
|
// CHECK-PPC64: "-cc1" "-triple" "powerpc64-pc-freebsd8"
|
2012-01-26 09:35:15 +08:00
|
|
|
// CHECK-PPC64: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]"
|
|
|
|
// CHECK-PPC64: "--eh-frame-hdr" "-dynamic-linker" "{{.*}}ld-elf{{.*}}" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "-L[[SYSROOT]]/usr/lib" "{{.*}}.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "{{.*}}crtend.o" "{{.*}}crtn.o"
|
|
|
|
//
|
2010-08-11 01:39:05 +08:00
|
|
|
//
|
2012-01-26 09:35:15 +08:00
|
|
|
// Check that -m32 properly adjusts the toolchain flags.
|
|
|
|
//
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -m32 %s \
|
|
|
|
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LIB32 %s
|
2014-06-27 19:18:13 +08:00
|
|
|
// CHECK-LIB32: "-cc1" "-triple" "i386-pc-freebsd8"
|
2010-08-11 01:39:05 +08:00
|
|
|
// CHECK-LIB32: ld{{.*}}" {{.*}} "-m" "elf_i386_fbsd"
|
|
|
|
//
|
2012-01-26 09:35:15 +08:00
|
|
|
// RUN: %clang -target x86_64-pc-freebsd8 -m32 %s 2>&1 \
|
|
|
|
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -print-search-dirs 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LIB32PATHS %s
|
2011-01-29 02:28:30 +08:00
|
|
|
// CHECK-LIB32PATHS: libraries: ={{.*:?}}/usr/lib32
|
2012-07-16 05:18:01 +08:00
|
|
|
//
|
|
|
|
// Check that the new linker flags are passed to FreeBSD
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -m32 %s \
|
|
|
|
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
|
2012-07-29 23:24:44 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LDFLAGS8 %s
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd9 -m32 %s \
|
|
|
|
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LDFLAGS9 %s
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd10.0 -m32 %s \
|
|
|
|
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LDFLAGS9 %s
|
|
|
|
// CHECK-LDFLAGS8-NOT: --hash-style=both
|
|
|
|
// CHECK-LDFLAGS8: --enable-new-dtags
|
|
|
|
// CHECK-LDFLAGS9: --hash-style=both
|
|
|
|
// CHECK-LDFLAGS9: --enable-new-dtags
|
2012-09-06 05:32:44 +08:00
|
|
|
//
|
|
|
|
// Check that we do not pass --hash-style=gnu and --hash-style=both to linker
|
|
|
|
// and provide correct path to the dynamic linker for MIPS platforms.
|
|
|
|
// Also verify that we tell the assembler to target the right ISA and ABI.
|
|
|
|
// RUN: %clang %s -### -o %t.o 2>&1 \
|
2012-10-10 04:46:28 +08:00
|
|
|
// RUN: -target mips-unknown-freebsd10.0 \
|
2012-09-06 05:32:44 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-MIPS %s
|
2012-09-07 00:29:03 +08:00
|
|
|
// CHECK-MIPS: "{{[^" ]*}}ld{{[^" ]*}}"
|
2012-09-06 05:32:44 +08:00
|
|
|
// CHECK-MIPS: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1"
|
|
|
|
// CHECK-MIPS-NOT: "--hash-style={{gnu|both}}"
|
|
|
|
// RUN: %clang %s -### -o %t.o 2>&1 \
|
2012-10-10 04:46:28 +08:00
|
|
|
// RUN: -target mipsel-unknown-freebsd10.0 \
|
2012-09-06 05:32:44 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-MIPSEL %s
|
2012-09-07 00:29:03 +08:00
|
|
|
// CHECK-MIPSEL: "{{[^" ]*}}ld{{[^" ]*}}"
|
2012-09-06 05:32:44 +08:00
|
|
|
// CHECK-MIPSEL: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1"
|
|
|
|
// CHECK-MIPSEL-NOT: "--hash-style={{gnu|both}}"
|
2014-02-26 02:35:30 +08:00
|
|
|
// RUN: %clang %s -### 2>&1 \
|
2012-10-10 04:46:28 +08:00
|
|
|
// RUN: -target mips64-unknown-freebsd10.0 \
|
2012-09-06 05:32:44 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-MIPS64 %s
|
2012-09-07 00:29:03 +08:00
|
|
|
// CHECK-MIPS64: "{{[^" ]*}}ld{{[^" ]*}}"
|
2012-09-06 05:32:44 +08:00
|
|
|
// CHECK-MIPS64: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1"
|
|
|
|
// CHECK-MIPS64-NOT: "--hash-style={{gnu|both}}"
|
2014-02-26 02:35:30 +08:00
|
|
|
// RUN: %clang %s -### 2>&1 \
|
2012-10-10 04:46:28 +08:00
|
|
|
// RUN: -target mips64el-unknown-freebsd10.0 \
|
2012-09-06 05:32:44 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL %s
|
2012-09-07 00:29:03 +08:00
|
|
|
// CHECK-MIPS64EL: "{{[^" ]*}}ld{{[^" ]*}}"
|
2012-09-06 05:32:44 +08:00
|
|
|
// CHECK-MIPS64EL: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1"
|
|
|
|
// CHECK-MIPS64EL-NOT: "--hash-style={{gnu|both}}"
|
2012-07-16 05:18:01 +08:00
|
|
|
|
2012-08-28 23:09:03 +08:00
|
|
|
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -static %s \
|
|
|
|
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-STATIC %s
|
|
|
|
// CHECK-STATIC: crt1.o
|
|
|
|
// CHECK-STATIC: crtbeginT.o
|
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -shared %s \
|
|
|
|
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-SHARED %s
|
|
|
|
// CHECK-SHARED: crti.o
|
|
|
|
// CHECK-SHARED: crtbeginS.o
|
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -pie %s \
|
|
|
|
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-PIE %s
|
|
|
|
// CHECK-PIE: pie
|
|
|
|
// CHECK-PIE: Scrt1.o
|
|
|
|
// CHECK-PIE: crtbeginS.o
|
|
|
|
|
|
|
|
// RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 %s \
|
|
|
|
// RUN: --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
|
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-NORMAL %s
|
|
|
|
// CHECK-NORMAL: crt1.o
|
|
|
|
// CHECK-NORMAL: crtbegin.o
|
2012-12-13 12:17:14 +08:00
|
|
|
|
2014-02-26 02:35:30 +08:00
|
|
|
// RUN: %clang %s -### -target arm-unknown-freebsd10.0 -no-integrated-as 2>&1 \
|
2012-12-13 12:17:14 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-ARM %s
|
2014-06-27 19:18:13 +08:00
|
|
|
// CHECK-ARM: "-cc1"{{.*}}" "-fsjlj-exceptions"
|
2012-12-13 12:17:14 +08:00
|
|
|
// CHECK-ARM: as{{.*}}" "-mfpu=softvfp"{{.*}}"-matpcs"
|
2014-02-19 18:44:07 +08:00
|
|
|
// CHECK-ARM-EABI-NOT: as{{.*}}" "-mfpu=vfp"
|
2012-12-13 12:17:14 +08:00
|
|
|
|
2014-02-26 02:35:30 +08:00
|
|
|
// RUN: %clang %s -### -target arm-gnueabi-freebsd10.0 -no-integrated-as 2>&1 \
|
2012-12-13 12:17:14 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-ARM-EABI %s
|
2014-06-27 19:18:13 +08:00
|
|
|
// CHECK-ARM-EABI-NOT: "-cc1"{{.*}}" "-fsjlj-exceptions"
|
2013-03-18 15:59:20 +08:00
|
|
|
// CHECK-ARM-EABI: as{{.*}}" "-mfpu=softvfp" "-meabi=5"
|
2014-02-19 18:44:07 +08:00
|
|
|
// CHECK-ARM-EABI-NOT: as{{.*}}" "-mfpu=vfp"
|
2012-12-13 12:17:14 +08:00
|
|
|
// CHECK-ARM-EABI-NOT: as{{.*}}" "-matpcs"
|
2013-11-12 02:24:28 +08:00
|
|
|
|
2014-02-26 02:35:30 +08:00
|
|
|
// RUN: %clang %s -### -target arm-gnueabihf-freebsd10.0 -no-integrated-as 2>&1 \
|
2014-02-19 18:44:07 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-ARM-EABIHF %s
|
2014-06-27 19:18:13 +08:00
|
|
|
// CHECK-ARM-EABIHF-NOT: "-cc1"{{.*}}" "-fsjlj-exceptions"
|
2014-02-19 18:44:07 +08:00
|
|
|
// CHECK-ARM-EABIHF: as{{.*}}" "-mfpu=vfp" "-meabi=5"
|
|
|
|
// CHECK-ARM-EABIHF-NOT: as{{.*}}" "-mfpu=softvfp"
|
|
|
|
// CHECK-ARM-EABIHF-NOT: as{{.*}}" "-matpcs"
|
|
|
|
|
2014-02-26 02:35:30 +08:00
|
|
|
// RUN: %clang -target x86_64-pc-freebsd8 %s -### -flto 2>&1 \
|
2013-11-12 02:24:28 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-LTO %s
|
|
|
|
// CHECK-LTO: ld{{.*}}" "-plugin{{.*}}LLVMgold.so
|
2014-01-03 01:18:03 +08:00
|
|
|
|
2015-01-14 15:55:36 +08:00
|
|
|
// RUN: %clang -target sparc-unknown-freebsd8 %s -### -fpic -no-integrated-as 2>&1 \
|
2014-01-03 01:18:03 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-SPARC-PIE %s
|
|
|
|
// CHECK-SPARC-PIE: as{{.*}}" "-KPIC
|
2014-02-26 02:35:30 +08:00
|
|
|
|
2015-01-14 15:55:36 +08:00
|
|
|
// RUN: %clang -mcpu=ultrasparc -target sparc64-unknown-freebsd8 %s -### -no-integrated-as 2>&1 \
|
2014-02-26 02:35:30 +08:00
|
|
|
// RUN: | FileCheck --check-prefix=CHECK-SPARC-CPU %s
|
|
|
|
// CHECK-SPARC-CPU: cc1{{.*}}" "-target-cpu" "ultrasparc"
|
2015-11-10 08:40:29 +08:00
|
|
|
// CHECK-SPARC-CPU: as{{.*}}" "-Av9
|