• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang -no-canonical-prefixes \
2 // RUN:   -target powerpc-pc-freebsd8 %s    \
3 // RUN:   --sysroot=%S/Inputs/basic_freebsd_tree -### 2>&1 \
4 // RUN:   | FileCheck --check-prefix=CHECK-PPC %s
5 // CHECK-PPC: "-cc1" "-triple" "powerpc-pc-freebsd8"
6 // CHECK-PPC: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]"
7 // 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"
8 //
9 // RUN: %clang -no-canonical-prefixes \
10 // RUN:   -target powerpc64-pc-freebsd8 %s                              \
11 // RUN:   --sysroot=%S/Inputs/basic_freebsd64_tree -### 2>&1 \
12 // RUN:   | FileCheck --check-prefix=CHECK-PPC64 %s
13 // CHECK-PPC64: "-cc1" "-triple" "powerpc64-pc-freebsd8"
14 // CHECK-PPC64: ld{{.*}}" "--sysroot=[[SYSROOT:[^"]+]]"
15 // 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"
16 //
17 //
18 // Check that -m32 properly adjusts the toolchain flags.
19 //
20 // RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -m32 %s \
21 // RUN:   --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
22 // RUN:   | FileCheck --check-prefix=CHECK-LIB32 %s
23 // CHECK-LIB32: "-cc1" "-triple" "i386-pc-freebsd8"
24 // CHECK-LIB32: ld{{.*}}" {{.*}} "-m" "elf_i386_fbsd"
25 //
26 // RUN: %clang -target x86_64-pc-freebsd8 -m32 %s 2>&1 \
27 // RUN:   --sysroot=%S/Inputs/multiarch_freebsd64_tree -print-search-dirs 2>&1 \
28 // RUN:   | FileCheck --check-prefix=CHECK-LIB32PATHS %s
29 // CHECK-LIB32PATHS: libraries: ={{.*:?}}/usr/lib32
30 //
31 // Check that the new linker flags are passed to FreeBSD
32 // RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -m32 %s \
33 // RUN:   --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
34 // RUN:   | FileCheck --check-prefix=CHECK-LDFLAGS8 %s
35 // RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd9 -m32 %s \
36 // RUN:   --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
37 // RUN:   | FileCheck --check-prefix=CHECK-LDFLAGS9 %s
38 // RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd10.0 -m32 %s \
39 // RUN:   --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
40 // RUN:   | FileCheck --check-prefix=CHECK-LDFLAGS9 %s
41 // CHECK-LDFLAGS8-NOT: --hash-style=both
42 // CHECK-LDFLAGS8: --enable-new-dtags
43 // CHECK-LDFLAGS9: --hash-style=both
44 // CHECK-LDFLAGS9: --enable-new-dtags
45 //
46 // Check that we do not pass --hash-style=gnu and --hash-style=both to linker
47 // and provide correct path to the dynamic linker for MIPS platforms.
48 // Also verify that we tell the assembler to target the right ISA and ABI.
49 // RUN: %clang %s -### -o %t.o 2>&1 \
50 // RUN:     -target mips-unknown-freebsd10.0 \
51 // RUN:   | FileCheck --check-prefix=CHECK-MIPS %s
52 // CHECK-MIPS: "{{[^" ]*}}ld{{[^" ]*}}"
53 // CHECK-MIPS: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1"
54 // CHECK-MIPS-NOT: "--hash-style={{gnu|both}}"
55 // RUN: %clang %s -### -o %t.o 2>&1 \
56 // RUN:     -target mipsel-unknown-freebsd10.0 \
57 // RUN:   | FileCheck --check-prefix=CHECK-MIPSEL %s
58 // CHECK-MIPSEL: "{{[^" ]*}}ld{{[^" ]*}}"
59 // CHECK-MIPSEL: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1"
60 // CHECK-MIPSEL-NOT: "--hash-style={{gnu|both}}"
61 // RUN: %clang %s -### 2>&1 \
62 // RUN:     -target mips64-unknown-freebsd10.0 \
63 // RUN:   | FileCheck --check-prefix=CHECK-MIPS64 %s
64 // CHECK-MIPS64: "{{[^" ]*}}ld{{[^" ]*}}"
65 // CHECK-MIPS64: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1"
66 // CHECK-MIPS64-NOT: "--hash-style={{gnu|both}}"
67 // RUN: %clang %s -### 2>&1 \
68 // RUN:     -target mips64el-unknown-freebsd10.0 \
69 // RUN:   | FileCheck --check-prefix=CHECK-MIPS64EL %s
70 // CHECK-MIPS64EL: "{{[^" ]*}}ld{{[^" ]*}}"
71 // CHECK-MIPS64EL: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1"
72 // CHECK-MIPS64EL-NOT: "--hash-style={{gnu|both}}"
73 
74 // RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -static %s \
75 // RUN:   --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
76 // RUN:   | FileCheck --check-prefix=CHECK-STATIC %s
77 // CHECK-STATIC: crt1.o
78 // CHECK-STATIC: crtbeginT.o
79 
80 // RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -shared %s \
81 // RUN:   --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
82 // RUN:   | FileCheck --check-prefix=CHECK-SHARED %s
83 // CHECK-SHARED: crti.o
84 // CHECK-SHARED: crtbeginS.o
85 
86 // RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 -pie %s \
87 // RUN:   --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
88 // RUN:   | FileCheck --check-prefix=CHECK-PIE %s
89 // CHECK-PIE: pie
90 // CHECK-PIE: Scrt1.o
91 // CHECK-PIE: crtbeginS.o
92 
93 // RUN: %clang -no-canonical-prefixes -target x86_64-pc-freebsd8 %s \
94 // RUN:   --sysroot=%S/Inputs/multiarch_freebsd64_tree -### 2>&1 \
95 // RUN:   | FileCheck --check-prefix=CHECK-NORMAL %s
96 // CHECK-NORMAL: crt1.o
97 // CHECK-NORMAL: crtbegin.o
98 
99 // RUN: %clang %s -### -target arm-unknown-freebsd10.0 -no-integrated-as 2>&1 \
100 // RUN:   | FileCheck --check-prefix=CHECK-ARM %s
101 // CHECK-ARM: "-cc1"{{.*}}" "-fsjlj-exceptions"
102 // CHECK-ARM: as{{.*}}" "-mfpu=softvfp"{{.*}}"-matpcs"
103 // CHECK-ARM-EABI-NOT: as{{.*}}" "-mfpu=vfp"
104 
105 // RUN: %clang %s -### -target arm-gnueabi-freebsd10.0 -no-integrated-as 2>&1 \
106 // RUN:   | FileCheck --check-prefix=CHECK-ARM-EABI %s
107 // CHECK-ARM-EABI-NOT: "-cc1"{{.*}}" "-fsjlj-exceptions"
108 // CHECK-ARM-EABI: as{{.*}}" "-mfpu=softvfp" "-meabi=5"
109 // CHECK-ARM-EABI-NOT: as{{.*}}" "-mfpu=vfp"
110 // CHECK-ARM-EABI-NOT: as{{.*}}" "-matpcs"
111 
112 // RUN: %clang %s -### -target arm-gnueabihf-freebsd10.0 -no-integrated-as 2>&1 \
113 // RUN:   | FileCheck --check-prefix=CHECK-ARM-EABIHF %s
114 // CHECK-ARM-EABIHF-NOT: "-cc1"{{.*}}" "-fsjlj-exceptions"
115 // CHECK-ARM-EABIHF: as{{.*}}" "-mfpu=vfp" "-meabi=5"
116 // CHECK-ARM-EABIHF-NOT: as{{.*}}" "-mfpu=softvfp"
117 // CHECK-ARM-EABIHF-NOT: as{{.*}}" "-matpcs"
118 
119 // RUN: %clang -target x86_64-pc-freebsd8 %s -### -flto 2>&1 \
120 // RUN:   | FileCheck --check-prefix=CHECK-LTO %s
121 // CHECK-LTO: ld{{.*}}" "-plugin{{.*}}LLVMgold.so
122 
123 // RUN: %clang -target sparc-unknown-freebsd8 %s -### -fpic 2>&1 \
124 // RUN:   | FileCheck --check-prefix=CHECK-SPARC-PIE %s
125 // CHECK-SPARC-PIE: as{{.*}}" "-KPIC
126 
127 // RUN: %clang -mcpu=ultrasparc -target sparc64-unknown-freebsd8 %s -### 2>&1 \
128 // RUN:   | FileCheck --check-prefix=CHECK-SPARC-CPU %s
129 // CHECK-SPARC-CPU: cc1{{.*}}" "-target-cpu" "ultrasparc"
130 // CHECK-SPARC-CPU: as{{.*}}" "-Av9a
131