blob: 6507838ef7eabdee02846d0f7c5429bf2fa13417 [file] [log] [blame]
Rafael Espindola238b6a92012-10-09 20:46:28 +00001// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd %s -### 2>&1 \
Eric Christopherdc6cc872012-09-13 06:32:34 +00002// 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"
Daniel Dunbarf7b8eec2009-06-29 20:52:51 +00005
Rafael Espindola238b6a92012-10-09 20:46:28 +00006// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -pg -pthread %s -### 2>&1 \
Eric Christopherdc6cc872012-09-13 06:32:34 +00007// RUN: | FileCheck --check-prefix=CHECK-PG %s
8// CHECK-PG: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
Dmitri Gribenkoc117f392013-01-07 23:55:47 +00009// 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"
Rafael Espindola6cc2a682012-12-31 22:41:36 +000010
11// Check that the new linker flags are passed to OpenBSD
12// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -r %s -### 2>&1 \
13// RUN: | FileCheck --check-prefix=CHECK-LD-R %s
14// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -s %s -### 2>&1 \
15// RUN: | FileCheck --check-prefix=CHECK-LD-S %s
16// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -t %s -### 2>&1 \
17// RUN: | FileCheck --check-prefix=CHECK-LD-T %s
18// RUN: %clang -no-canonical-prefixes -target i686-pc-openbsd -Z %s -### 2>&1 \
19// RUN: | FileCheck --check-prefix=CHECK-LD-Z %s
Bill Wendlingac66cb82013-12-08 00:21:01 +000020// RUN: %clang -no-canonical-prefixes -target mips64-unknown-openbsd %s -### 2>&1 \
21// RUN: | FileCheck --check-prefix=CHECK-MIPS64-LD %s
22// RUN: %clang -no-canonical-prefixes -target mips64el-unknown-openbsd %s -### 2>&1 \
23// RUN: | FileCheck --check-prefix=CHECK-MIPS64EL-LD %s
Rafael Espindola6cc2a682012-12-31 22:41:36 +000024// CHECK-LD-R: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
25// 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"
26// CHECK-LD-S: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
27// 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"
28// CHECK-LD-T: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
29// 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"
30// CHECK-LD-Z: clang{{.*}}" "-cc1" "-triple" "i686-pc-openbsd"
31// 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"
Bill Wendlingac66cb82013-12-08 00:21:01 +000032// CHECK-MIPS64-LD: clang{{.*}}" "-cc1" "-triple" "mips64-unknown-openbsd"
33// 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"
34// CHECK-MIPS64EL-LD: clang{{.*}}" "-cc1" "-triple" "mips64el-unknown-openbsd"
35// 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"
36
37// Check passing options to the assembler for various OpenBSD targets
38// RUN: %clang -target amd64-pc-openbsd -m32 -### -no-integrated-as -c %s 2>&1 \
39// RUN: | FileCheck -check-prefix=CHECK-AMD64-M32 %s
40// RUN: %clang -target powerpc-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \
41// RUN: | FileCheck -check-prefix=CHECK-POWERPC %s
Stephen Hines651f13c2014-04-23 16:59:28 -070042// RUN: %clang -target sparc-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \
43// RUN: | FileCheck -check-prefix=CHECK-SPARC %s
44// RUN: %clang -target sparc64-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \
45// RUN: | FileCheck -check-prefix=CHECK-SPARC64 %s
Bill Wendlingac66cb82013-12-08 00:21:01 +000046// RUN: %clang -target mips64-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \
47// RUN: | FileCheck -check-prefix=CHECK-MIPS64 %s
48// RUN: %clang -target mips64-unknown-openbsd -fPIC -### -no-integrated-as -c %s 2>&1 \
49// RUN: | FileCheck -check-prefix=CHECK-MIPS64-PIC %s
50// RUN: %clang -target mips64el-unknown-openbsd -### -no-integrated-as -c %s 2>&1 \
51// RUN: | FileCheck -check-prefix=CHECK-MIPS64EL %s
52// RUN: %clang -target mips64el-unknown-openbsd -fPIC -### -no-integrated-as -c %s 2>&1 \
53// RUN: | FileCheck -check-prefix=CHECK-MIPS64EL-PIC %s
54// CHECK-AMD64-M32: as{{.*}}" "--32"
55// CHECK-POWERPC: as{{.*}}" "-mppc" "-many"
Stephen Hines651f13c2014-04-23 16:59:28 -070056// CHECK-SPARC: as{{.*}}" "-32"
57// CHECK-SPARC64: as{{.*}}" "-64" "-Av9a"
Bill Wendlingac66cb82013-12-08 00:21:01 +000058// CHECK-MIPS64: as{{.*}}" "-mabi" "64" "-EB"
59// CHECK-MIPS64-PIC: as{{.*}}" "-mabi" "64" "-EB" "-KPIC"
60// CHECK-MIPS64EL: as{{.*}}" "-mabi" "64" "-EL"
61// CHECK-MIPS64EL-PIC: as{{.*}}" "-mabi" "64" "-EL" "-KPIC"
Stephen Hinesc568f1e2014-07-21 00:47:37 -070062
63// Check that the integrated assembler is enabled for PowerPC
64// RUN: %clang -target powerpc-unknown-openbsd -### -c %s 2>&1 \
65// RUN: | FileCheck -check-prefix=CHECK-POWERPC-AS %s
66// CHECK-POWERPC-AS-NOT: "-no-integrated-as"