[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Driver / haiku.c
blob3f421ab6e81e686878a1010de5c26801d9ecb254
1 // UNSUPPORTED: system-windows
3 // Check the C header paths
4 // RUN: %clang --target=x86_64-unknown-haiku -### %s 2>&1 \
5 // RUN: | FileCheck --check-prefix=CHECK-C-HEADER-PATH %s
6 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/non-packaged/develop/headers"
7 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os"
8 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/app"
9 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/device"
10 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/drivers"
11 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/game"
12 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/interface"
13 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/kernel"
14 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/locale"
15 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/mail"
16 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/media"
17 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/midi"
18 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/midi2"
19 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/net"
20 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/opengl"
21 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/storage"
22 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/support"
23 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/translation"
24 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/add-ons/graphics"
25 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/add-ons/input_server"
26 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/add-ons/mail_daemon"
27 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/add-ons/registrar"
28 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/add-ons/screen_saver"
29 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/add-ons/tracker"
30 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/be_apps/Deskbar"
31 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/be_apps/NetPositive"
32 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/os/be_apps/Tracker"
33 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/3rdparty"
34 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/bsd"
35 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/glibc"
36 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/gnu"
37 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers/posix"
38 // CHECK-C-HEADER-PATH: "-internal-isystem" "/boot/system/develop/headers"
40 // Check x86_64-unknown-haiku, X86_64
41 // RUN: %clang -### %s 2>&1 --target=x86_64-unknown-haiku \
42 // RUN: --sysroot=%S/Inputs/haiku_x86_64_tree \
43 // RUN: | FileCheck --check-prefix=CHECK-LD-X86_64 %s
44 // CHECK-LD-X86_64: "-cc1" "-triple" "x86_64-unknown-haiku"
45 // CHECK-LD-X86_64-SAME: "-isysroot" "[[SYSROOT:[^"]+]]"
46 // CHECK-LD-X86_64: "{{.*}}ld{{(.exe)?}}"
47 // CHECK-LD-X86_64-SAME: "--no-undefined"
48 // CHECK-LD-X86_64-SAME: "[[SYSROOT]]/boot/system/develop/lib/crti.o"
49 // CHECK-LD-X86_64-SAME: {{^}} "[[SYSROOT]]/boot/system/develop/tools/lib/gcc/x86_64-unknown-haiku/13.2.0/crtbeginS.o"
50 // CHECK-LD-X86_64-SAME: {{^}} "[[SYSROOT]]/boot/system/develop/lib/start_dyn.o"
51 // CHECK-LD-X86_64-SAME: {{^}} "[[SYSROOT]]/boot/system/develop/lib/init_term_dyn.o"
52 // CHECK-LD-X86_64-SAME: "-lgcc" "--push-state" "--as-needed" "-lgcc_s" "--no-as-needed" "--pop-state"
53 // CHECK-LD-X86_64-SAME: {{^}} "-lroot"
54 // CHECK-LD-X86_64-SAME: {{^}} "-lgcc" "--push-state" "--as-needed" "-lgcc_s" "--no-as-needed" "--pop-state"
55 // CHECK-LD-X86_64-SAME: {{^}} "[[SYSROOT]]/boot/system/develop/tools/lib/gcc/x86_64-unknown-haiku/13.2.0/crtendS.o"
56 // CHECK-LD-X86_64-SAME: {{^}} "[[SYSROOT]]/boot/system/develop/lib/crtn.o"
58 // Check -rdynamic is a no-op
59 // RUN: %clang -### -rdynamic %s 2>&1 --target=x86_64-unknown-haiku \
60 // RUN: | FileCheck --check-prefix=CHECK-RDYNAMIC %s
61 // CHECK-RDYNAMIC-NOT: "-export-dynamic"
63 // Check the right flags are present with -shared
64 // RUN: %clang -### %s -shared 2>&1 --target=x86_64-unknown-haiku \
65 // RUN: --sysroot=%S/Inputs/haiku_x86_64_tree \
66 // RUN: | FileCheck --check-prefix=CHECK-X86_64-SHARED %s
67 // CHECK-X86_64-SHARED: "-cc1" "-triple" "x86_64-unknown-haiku"
68 // CHECK-X86_64-SHARED-SAME: "-isysroot" "[[SYSROOT:[^"]+]]"
69 // CHECK-X86_64-SHARED: "{{.*}}ld{{(.exe)?}}"
70 // CHECK-X86_64-SHARED-NOT: "[[SYSROOT]]/boot/system/develop/lib/start_dyn.o"
72 // Check default ARM CPU, ARMv6
73 // RUN: %clang -### %s 2>&1 --target=arm-unknown-haiku \
74 // RUN: | FileCheck --check-prefix=CHECK-ARM-CPU %s
75 // CHECK-ARM-CPU: "-target-cpu" "arm1176jzf-s"
77 // Check that the -X and --no-relax flags are passed to the linker on riscv64
78 // RUN: %clang --target=riscv64-unknown-haiku -mno-relax -### %s 2>&1 \
79 // RUN: | FileCheck -check-prefix=RISCV64-FLAGS %s
80 // RISCV64-FLAGS: "-X" "--no-relax"
82 // Check passing LTO flags to the linker
83 // RUN: %clang --target=x86_64-unknown-haiku -flto -### %s 2>&1 \
84 // RUN: | FileCheck -check-prefix=CHECK-LTO-FLAGS %s
85 // CHECK-LTO-FLAGS: "-plugin-opt=mcpu=x86-64"