xref: /minix3/external/bsd/llvm/dist/clang/test/Driver/openbsd.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -### 2>&1 \
2f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-LD %s
3f4a2713aSLionel Sambuc // CHECK-LD: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
4f4a2713aSLionel Sambuc // 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"
5f4a2713aSLionel Sambuc 
6f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -pg -pthread %s -### 2>&1 \
7f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-PG %s
8f4a2713aSLionel Sambuc // CHECK-PG: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
9f4a2713aSLionel Sambuc // 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"
10f4a2713aSLionel Sambuc 
11*0a6a1f1dSLionel Sambuc // Check CPU type for MIPS64
12*0a6a1f1dSLionel Sambuc // RUN: %clang -target mips64-unknown-openbsd -### -c %s 2>&1 \
13*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck -check-prefix=CHECK-MIPS64-CPU %s
14*0a6a1f1dSLionel Sambuc // RUN: %clang -target mips64el-unknown-openbsd -### -c %s 2>&1 \
15*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck -check-prefix=CHECK-MIPS64EL-CPU %s
16*0a6a1f1dSLionel Sambuc // CHECK-MIPS64-CPU: "-target-cpu" "mips3"
17*0a6a1f1dSLionel Sambuc // CHECK-MIPS64EL-CPU: "-target-cpu" "mips3"
18*0a6a1f1dSLionel Sambuc 
19f4a2713aSLionel Sambuc // Check that the new linker flags are passed to OpenBSD
20f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -r %s -### 2>&1 \
21f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-LD-R %s
22f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -s %s -### 2>&1 \
23f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-LD-S %s
24f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -t %s -### 2>&1 \
25f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-LD-T %s
26f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -Z %s -### 2>&1 \
27f4a2713aSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-LD-Z %s
28*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes -target mips64-unknown-openbsd %s -### 2>&1 \
29*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-MIPS64-LD %s
30*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes -target mips64el-unknown-openbsd %s -### 2>&1 \
31*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck --check-prefix=CHECK-MIPS64EL-LD %s
32f4a2713aSLionel Sambuc // CHECK-LD-R: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
33f4a2713aSLionel Sambuc // 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"
34f4a2713aSLionel Sambuc // CHECK-LD-S: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
35f4a2713aSLionel Sambuc // 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"
36f4a2713aSLionel Sambuc // CHECK-LD-T: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
37f4a2713aSLionel Sambuc // 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"
38f4a2713aSLionel Sambuc // CHECK-LD-Z: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
39f4a2713aSLionel Sambuc // 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*0a6a1f1dSLionel Sambuc // CHECK-MIPS64-LD: clang{{.*}}" "-cc1" "-triple" "mips64-unknown-openbsd"
41*0a6a1f1dSLionel Sambuc // 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*0a6a1f1dSLionel Sambuc // CHECK-MIPS64EL-LD: clang{{.*}}" "-cc1" "-triple" "mips64el-unknown-openbsd"
43*0a6a1f1dSLionel Sambuc // 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*0a6a1f1dSLionel Sambuc 
45*0a6a1f1dSLionel Sambuc // Check passing options to the assembler for various OpenBSD targets
46*0a6a1f1dSLionel Sambuc // RUN: %clang -target amd64-pc-openbsd -m32 -### -no-integrated-as -c %s 2>&1 \
47*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck -check-prefix=CHECK-AMD64-M32 %s
48*0a6a1f1dSLionel Sambuc // RUN: %clang -target powerpc-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \
49*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck -check-prefix=CHECK-POWERPC %s
50*0a6a1f1dSLionel Sambuc // RUN: %clang -target sparc-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \
51*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck -check-prefix=CHECK-SPARC %s
52*0a6a1f1dSLionel Sambuc // RUN: %clang -target sparc64-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \
53*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck -check-prefix=CHECK-SPARC64 %s
54*0a6a1f1dSLionel Sambuc // RUN: %clang -target mips64-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \
55*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck -check-prefix=CHECK-MIPS64 %s
56*0a6a1f1dSLionel Sambuc // RUN: %clang -target mips64-unknown-openbsd -fPIC -### -no-integrated-as -c %s 2>&1 \
57*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck -check-prefix=CHECK-MIPS64-PIC %s
58*0a6a1f1dSLionel Sambuc // RUN: %clang -target mips64el-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \
59*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck -check-prefix=CHECK-MIPS64EL %s
60*0a6a1f1dSLionel Sambuc // RUN: %clang -target mips64el-unknown-openbsd -fPIC -### -no-integrated-as -c %s 2>&1 \
61*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck -check-prefix=CHECK-MIPS64EL-PIC %s
62*0a6a1f1dSLionel Sambuc // CHECK-AMD64-M32: as{{.*}}" "--32"
63*0a6a1f1dSLionel Sambuc // CHECK-POWERPC: as{{.*}}" "-mppc" "-many"
64*0a6a1f1dSLionel Sambuc // CHECK-SPARC: as{{.*}}" "-32"
65*0a6a1f1dSLionel Sambuc // CHECK-SPARC64: as{{.*}}" "-64" "-Av9a"
66*0a6a1f1dSLionel Sambuc // CHECK-MIPS64: as{{.*}}" "-mabi" "64" "-EB"
67*0a6a1f1dSLionel Sambuc // CHECK-MIPS64-PIC: as{{.*}}" "-mabi" "64" "-EB" "-KPIC"
68*0a6a1f1dSLionel Sambuc // CHECK-MIPS64EL: as{{.*}}" "-mabi" "64" "-EL"
69*0a6a1f1dSLionel Sambuc // CHECK-MIPS64EL-PIC: as{{.*}}" "-mabi" "64" "-EL" "-KPIC"
70