1 // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -### 2>&1 \ 2 // RUN: | FileCheck --check-prefix=CHECK-LD %s 3 // CHECK-LD: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd" 4 // CHECK-LD: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o" 5 6 // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -pg -pthread %s -### 2>&1 \ 7 // RUN: | FileCheck --check-prefix=CHECK-PG %s 8 // CHECK-PG: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd" 9 // CHECK-PG: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}gcrt0.o" "{{.*}}crtbegin.o" "{{.*}}.o" "-lgcc" "-lpthread_p" "-lc_p" "-lgcc" "{{.*}}crtend.o" 10 11 // Check CPU type for MIPS64 12 // RUN: %clang -target mips64-unknown-openbsd -### -c %s 2>&1 \ 13 // RUN: | FileCheck -check-prefix=CHECK-MIPS64-CPU %s 14 // RUN: %clang -target mips64el-unknown-openbsd -### -c %s 2>&1 \ 15 // RUN: | FileCheck -check-prefix=CHECK-MIPS64EL-CPU %s 16 // CHECK-MIPS64-CPU: "-target-cpu" "mips3" 17 // CHECK-MIPS64EL-CPU: "-target-cpu" "mips3" 18 19 // Check that the new linker flags are passed to OpenBSD 20 // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -r %s -### 2>&1 \ 21 // RUN: | FileCheck --check-prefix=CHECK-LD-R %s 22 // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -s %s -### 2>&1 \ 23 // RUN: | FileCheck --check-prefix=CHECK-LD-S %s 24 // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -t %s -### 2>&1 \ 25 // RUN: | FileCheck --check-prefix=CHECK-LD-T %s 26 // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -Z %s -### 2>&1 \ 27 // RUN: | FileCheck --check-prefix=CHECK-LD-Z %s 28 // RUN: %clang -no-canonical-prefixes -target mips64-unknown-openbsd %s -### 2>&1 \ 29 // RUN: | FileCheck --check-prefix=CHECK-MIPS64-LD %s 30 // RUN: %clang -no-canonical-prefixes -target mips64el-unknown-openbsd %s -### 2>&1 \ 31 // RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-LD %s 32 // CHECK-LD-R: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd" 33 // CHECK-LD-R: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-r" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o" 34 // CHECK-LD-S: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd" 35 // CHECK-LD-S: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-s" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o" 36 // CHECK-LD-T: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd" 37 // CHECK-LD-T: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-t" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o" 38 // CHECK-LD-Z: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd" 39 // CHECK-LD-Z: ld{{.*}}" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "-Z" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o" 40 // CHECK-MIPS64-LD: clang{{.*}}" "-cc1" "-triple" "mips64-unknown-openbsd" 41 // CHECK-MIPS64-LD: ld{{.*}}" "-EB" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o" 42 // CHECK-MIPS64EL-LD: clang{{.*}}" "-cc1" "-triple" "mips64el-unknown-openbsd" 43 // CHECK-MIPS64EL-LD: ld{{.*}}" "-EL" "-e" "__start" "--eh-frame-hdr" "-Bdynamic" "-dynamic-linker" "{{.*}}ld.so" "-o" "a.out" "{{.*}}crt0.o" "{{.*}}crtbegin.o" "-L{{.*}}" "{{.*}}.o" "-lgcc" "-lc" "-lgcc" "{{.*}}crtend.o" 44 45 // Check passing options to the assembler for various OpenBSD targets 46 // RUN: %clang -target amd64-pc-openbsd -m32 -### -no-integrated-as -c %s 2>&1 \ 47 // RUN: | FileCheck -check-prefix=CHECK-AMD64-M32 %s 48 // RUN: %clang -target powerpc-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \ 49 // RUN: | FileCheck -check-prefix=CHECK-POWERPC %s 50 // RUN: %clang -target sparc-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \ 51 // RUN: | FileCheck -check-prefix=CHECK-SPARC %s 52 // RUN: %clang -target sparc64-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \ 53 // RUN: | FileCheck -check-prefix=CHECK-SPARC64 %s 54 // RUN: %clang -target mips64-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \ 55 // RUN: | FileCheck -check-prefix=CHECK-MIPS64 %s 56 // RUN: %clang -target mips64-unknown-openbsd -fPIC -### -no-integrated-as -c %s 2>&1 \ 57 // RUN: | FileCheck -check-prefix=CHECK-MIPS64-PIC %s 58 // RUN: %clang -target mips64el-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \ 59 // RUN: | FileCheck -check-prefix=CHECK-MIPS64EL %s 60 // RUN: %clang -target mips64el-unknown-openbsd -fPIC -### -no-integrated-as -c %s 2>&1 \ 61 // RUN: | FileCheck -check-prefix=CHECK-MIPS64EL-PIC %s 62 // CHECK-AMD64-M32: as{{.*}}" "--32" 63 // CHECK-POWERPC: as{{.*}}" "-mppc" "-many" 64 // CHECK-SPARC: as{{.*}}" "-32" "-Av8" 65 // CHECK-SPARC64: as{{.*}}" "-64" "-Av9" 66 // CHECK-MIPS64: as{{.*}}" "-mabi" "64" "-EB" 67 // CHECK-MIPS64-PIC: as{{.*}}" "-mabi" "64" "-EB" "-KPIC" 68 // CHECK-MIPS64EL: as{{.*}}" "-mabi" "64" "-EL" 69 // CHECK-MIPS64EL-PIC: as{{.*}}" "-mabi" "64" "-EL" "-KPIC" 70