brintos

brintos / llvm-project-archived public Read only

0
0
Text · 7.6 KiB · 1f12cfc Raw
152 lines · c
1// Check for --eh-frame-hdr being passed with static linking2// RUN: %clang --target=i686-pc-openbsd -static -### %s 2>&1 \3// RUN:   | FileCheck --check-prefix=CHECK-LD-STATIC-EH %s4// CHECK-LD-STATIC-EH: "-cc1" "-triple" "i686-pc-openbsd"5// CHECK-LD-STATIC-EH: ld{{.*}}" "{{.*}}" "--eh-frame-hdr" "-Bstatic"6 7// Check for profiling variants of libraries when linking and -nopie8// RUN: %clang --target=i686-pc-openbsd -pg -pthread -### %s 2>&1 \9// RUN:   | FileCheck --check-prefix=CHECK-PG %s10// CHECK-PG: "-cc1" "-triple" "i686-pc-openbsd"11// CHECK-PG: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-dynamic-linker" "{{.*}}ld.so" "-nopie" "-o" "a.out" "{{.*}}gcrt0.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lcompiler_rt" "-lpthread_p" "-lc_p" "-lcompiler_rt" "{{.*}}crtend.o"12 13// Check for variants of crt* when creating shared libs14// RUN: %clang --target=i686-pc-openbsd -pthread -shared -### %s 2>&1 \15// RUN:   | FileCheck --check-prefix=CHECK-SHARED %s16// CHECK-SHARED: "-cc1" "-triple" "i686-pc-openbsd"17// CHECK-SHARED: ld{{.*}}" "--eh-frame-hdr" "-shared" "-o" "a.out" "{{.*}}crtbeginS.o" "{{.*}}.o" "-lcompiler_rt" "-lpthread" "-lcompiler_rt" "{{.*}}crtendS.o"18 19// Check CPU type for i38620// RUN: %clang --target=i386-unknown-openbsd -### -c %s 2>&1 \21// RUN:   | FileCheck -check-prefix=CHECK-i386-CPU %s22// CHECK-i386-CPU: "-target-cpu" "i586"23 24// Check CPU type for MIPS6425// RUN: %clang --target=mips64-unknown-openbsd -### -c %s 2>&1 \26// RUN:   | FileCheck -check-prefix=CHECK-MIPS64-CPU %s27// RUN: %clang --target=mips64el-unknown-openbsd -### -c %s 2>&1 \28// RUN:   | FileCheck -check-prefix=CHECK-MIPS64EL-CPU %s29// CHECK-MIPS64-CPU: "-target-cpu" "mips3"30// CHECK-MIPS64EL-CPU: "-target-cpu" "mips3"31 32// Check that the new linker flags are passed to OpenBSD33// RUN: %clang --target=i686-pc-openbsd -r -### %s 2>&1 \34// RUN:   | FileCheck --check-prefix=CHECK-LD-R %s35// RUN: %clang --target=i686-pc-openbsd -s -t -### %s 2>&1 \36// RUN:   | FileCheck --check-prefix=CHECK-LD-ST %s37// RUN: %clang --target=mips64-unknown-openbsd -### %s 2>&1 \38// RUN:   | FileCheck --check-prefix=CHECK-MIPS64-LD %s39// RUN: %clang --target=mips64el-unknown-openbsd -### %s 2>&1 \40// RUN:   | FileCheck --check-prefix=CHECK-MIPS64EL-LD %s41// CHECK-LD-R-NOT: "-e"42// CHECK-LD-R-NOT: "-dynamic-linker"43// CHECK-LD-R-NOT: "-l44// CHECK-LD-R-NOT: crt{{[^./\\]+}}.o45// CHECK-LD-R:     "-r"46// CHECK-LD-ST: "-cc1" "-triple" "i686-pc-openbsd"47// CHECK-LD-ST: ld{{.*}}" "{{.*}}" "-s" "-t"48// CHECK-MIPS64-LD: "-cc1" "-triple" "mips64-unknown-openbsd"49// CHECK-MIPS64-LD: ld{{.*}}" "-EB"50// CHECK-MIPS64EL-LD: "-cc1" "-triple" "mips64el-unknown-openbsd"51// CHECK-MIPS64EL-LD: ld{{.*}}" "-EL"52 53// Check that --sysroot is passed to the linker54// RUN: %clang --target=i686-pc-openbsd -### %s 2>&1 \55// RUN:   --sysroot=%S/Inputs/basic_openbsd_tree \56// RUN:   | FileCheck --check-prefix=CHECK-LD-SYSROOT %s57// CHECK-LD-SYSROOT: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]"58 59// Check passing options to the assembler for various OpenBSD targets60// RUN: %clang --target=amd64-pc-openbsd -m32 -### -no-integrated-as -c %s 2>&1 \61// RUN:   | FileCheck -check-prefix=CHECK-AMD64-M32 %s62// RUN: %clang --target=arm-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \63// RUN:   | FileCheck -check-prefix=CHECK-ARM %s64// RUN: %clang --target=powerpc-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \65// RUN:   | FileCheck -check-prefix=CHECK-POWERPC %s66// RUN: %clang --target=sparc64-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \67// RUN:   | FileCheck -check-prefix=CHECK-SPARC64 %s68// RUN: %clang --target=mips64-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \69// RUN:   | FileCheck -check-prefix=CHECK-MIPS64 %s70// RUN: %clang --target=mips64-unknown-openbsd -fPIC -### -no-integrated-as -c %s 2>&1 \71// RUN:   | FileCheck -check-prefix=CHECK-MIPS64-PIC %s72// RUN: %clang --target=mips64el-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \73// RUN:   | FileCheck -check-prefix=CHECK-MIPS64EL %s74// RUN: %clang --target=mips64el-unknown-openbsd -fPIC -### -no-integrated-as -c %s 2>&1 \75// RUN:   | FileCheck -check-prefix=CHECK-MIPS64EL-PIC %s76// CHECK-AMD64-M32: as{{.*}}" "--32"77// CHECK-ARM: as{{.*}}" "-mcpu=cortex-a8"78// CHECK-POWERPC: as{{.*}}" "-mppc" "-many"79// CHECK-SPARC64: as{{.*}}" "-64" "-Av9a"80// CHECK-MIPS64: as{{.*}}" "-march" "mips3" "-mabi" "64" "-EB"81// CHECK-MIPS64-PIC: as{{.*}}" "-march" "mips3" "-mabi" "64" "-EB" "-KPIC"82// CHECK-MIPS64EL: as{{.*}}" "-mabi" "64" "-EL"83// CHECK-MIPS64EL-PIC: as{{.*}}" "-mabi" "64" "-EL" "-KPIC"84 85// Check linking against correct startup code when (not) using PIE86// RUN: %clang --target=i686-pc-openbsd -### %s 2>&1 \87// RUN:   | FileCheck -check-prefix=CHECK-PIE %s88// RUN: %clang --target=i686-pc-openbsd -pie -### %s 2>&1 \89// RUN:   | FileCheck -check-prefix=CHECK-PIE-FLAG %s90// RUN: %clang --target=i686-pc-openbsd -fno-pie -### %s 2>&1 \91// RUN:   | FileCheck -check-prefix=CHECK-PIE %s92// RUN: %clang --target=i686-pc-openbsd -static -### %s 2>&1 \93// RUN:   | FileCheck -check-prefix=CHECK-STATIC-PIE %s94// RUN: %clang --target=i686-pc-openbsd -static -fno-pie -### %s 2>&1 \95// RUN:   | FileCheck -check-prefix=CHECK-STATIC-PIE %s96// RUN: %clang --target=i686-pc-openbsd -nopie -### %s 2>&1 \97// RUN:   | FileCheck -check-prefix=CHECK-NOPIE %s98// RUN: %clang --target=i686-pc-openbsd -fno-pie -nopie -### %s 2>&1 \99// RUN:   | FileCheck -check-prefix=CHECK-NOPIE %s100// RUN: %clang --target=i686-pc-openbsd -static -nopie -### %s 2>&1 \101// RUN:   | FileCheck -check-prefix=CHECK-NOPIE %s102// RUN: %clang --target=i686-pc-openbsd -fno-pie -static -nopie -### %s 2>&1 \103// RUN:   | FileCheck -check-prefix=CHECK-NOPIE %s104// CHECK-PIE: "{{.*}}crt0.o"105// CHECK-PIE-NOT: "-nopie"106// CHECK-PIE-FLAG: "-pie"107// CHECK-STATIC-PIE: "{{.*}}rcrt0.o"108// CHECK-STATIC-PIE-NOT: "-nopie"109// CHECK-NOPIE: "-nopie" "{{.*}}crt0.o"110 111// Check ARM float ABI112// RUN: %clang --target=arm-unknown-openbsd -### -c %s 2>&1 \113// RUN:   | FileCheck -check-prefix=CHECK-ARM-FLOAT-ABI %s114// CHECK-ARM-FLOAT-ABI-NOT: "-target-feature" "+soft-float"115// CHECK-ARM-FLOAT-ABI: "-target-feature" "+soft-float-abi"116 117// Check PowerPC for Secure PLT118// RUN: %clang --target=powerpc-unknown-openbsd -### -c %s 2>&1 \119// RUN:   | FileCheck -check-prefix=CHECK-POWERPC-SECUREPLT %s120// CHECK-POWERPC-SECUREPLT: "-target-feature" "+secure-plt"121 122// Check that unwind tables are enabled123// RUN: %clang --target=arm-unknown-openbsd -### -S %s 2>&1 | \124// RUN: FileCheck -check-prefix=NO-UNWIND-TABLES %s125// RUN: %clang --target=mips64-unknown-openbsd -### -S %s 2>&1 | \126// RUN: FileCheck -check-prefix=UNWIND-TABLES %s127// UNWIND-TABLES: "-funwind-tables=2"128// NO-UNWIND-TABLES-NOT: "-funwind-tables=2"129 130// Check that the -X and --no-relax flags are passed to the linker131// RUN: %clang --target=loongarch64-unknown-openbsd -mno-relax -### %s 2>&1 \132// RUN:   | FileCheck --check-prefix=LA64-FLAGS %s133// RUN: %clang --target=riscv64-unknown-openbsd -mno-relax -### %s 2>&1 \134// RUN:   | FileCheck -check-prefix=RISCV64-FLAGS %s135// LA64-FLAGS: "-X" "--no-relax"136// RISCV64-FLAGS: "-X" "--no-relax"137 138// Check passing LTO flags to the linker139// RUN: %clang --target=amd64-unknown-openbsd -flto -### %s 2>&1 \140// RUN:   | FileCheck -check-prefix=CHECK-LTO-FLAGS %s141// CHECK-LTO-FLAGS: "-plugin-opt=mcpu=x86-64"142 143// Check 64-bit ARM for BTI and PAC flags144// RUN: %clang --target=aarch64-unknown-openbsd -### -c %s 2>&1 \145// RUN:   | FileCheck -check-prefix=CHECK-AARCH64-BTI-PAC %s146// CHECK-AARCH64-BTI-PAC: "-msign-return-address=non-leaf" "-msign-return-address-key=a_key" "-mbranch-target-enforce"147 148// Check 64-bit X86 for IBT flags149// RUN: %clang --target=amd64-unknown-openbsd -### -c %s 2>&1 \150// RUN:   | FileCheck -check-prefix=CHECK-AMD64-IBT %s151// CHECK-AMD64-IBT: "-fcf-protection=branch" "-fno-jump-tables"152