Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Driver / haiku.c
blob965d3cf97bc36bfeae201c718d27c9ec16f5ead6
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: --gcc-toolchain="" \
43 // RUN: --sysroot=%S/Inputs/haiku_x86_64_tree \
44 // RUN: | FileCheck --check-prefix=CHECK-LD-X86_64 %s
45 // CHECK-LD-X86_64: "-cc1" "-triple" "x86_64-unknown-haiku"
46 // CHECK-LD-X86_64-SAME: "-isysroot" "[[SYSROOT:[^"]+]]"
47 // CHECK-LD-X86_64: "{{.*}}ld{{(.exe)?}}"
48 // CHECK-LD-X86_64-SAME: "--no-undefined"
49 // CHECK-LD-X86_64-SAME: "[[SYSROOT]]/boot/system/develop/lib/crti.o"
50 // CHECK-LD-X86_64-SAME: {{^}} "[[SYSROOT]]/boot/system/develop/tools/lib/gcc/x86_64-unknown-haiku/13.2.0/crtbeginS.o"
51 // CHECK-LD-X86_64-SAME: {{^}} "[[SYSROOT]]/boot/system/develop/lib/start_dyn.o"
52 // CHECK-LD-X86_64-SAME: {{^}} "[[SYSROOT]]/boot/system/develop/lib/init_term_dyn.o"
53 // CHECK-LD-X86_64-SAME: "-lgcc" "--push-state" "--as-needed" "-lgcc_s" "--no-as-needed" "--pop-state"
54 // CHECK-LD-X86_64-SAME: {{^}} "-lroot"
55 // CHECK-LD-X86_64-SAME: {{^}} "-lgcc" "--push-state" "--as-needed" "-lgcc_s" "--no-as-needed" "--pop-state"
56 // CHECK-LD-X86_64-SAME: {{^}} "[[SYSROOT]]/boot/system/develop/tools/lib/gcc/x86_64-unknown-haiku/13.2.0/crtendS.o"
57 // CHECK-LD-X86_64-SAME: {{^}} "[[SYSROOT]]/boot/system/develop/lib/crtn.o"
59 // Check -rdynamic is a no-op
60 // RUN: %clang -### -rdynamic %s 2>&1 --target=x86_64-unknown-haiku \
61 // RUN: | FileCheck --check-prefix=CHECK-RDYNAMIC %s
62 // CHECK-RDYNAMIC-NOT: "-export-dynamic"
64 // Check the right flags are present with -shared
65 // RUN: %clang -### %s -shared 2>&1 --target=x86_64-unknown-haiku \
66 // RUN: --gcc-toolchain="" \
67 // RUN: --sysroot=%S/Inputs/haiku_x86_64_tree \
68 // RUN: | FileCheck --check-prefix=CHECK-X86_64-SHARED %s
69 // CHECK-X86_64-SHARED: "-cc1" "-triple" "x86_64-unknown-haiku"
70 // CHECK-X86_64-SHARED-SAME: "-isysroot" "[[SYSROOT:[^"]+]]"
71 // CHECK-X86_64-SHARED: "{{.*}}ld{{(.exe)?}}"
72 // CHECK-X86_64-SHARED-NOT: "[[SYSROOT]]/boot/system/develop/lib/start_dyn.o"
74 // Check default ARM CPU, ARMv6
75 // RUN: %clang -### %s 2>&1 --target=arm-unknown-haiku \
76 // RUN: | FileCheck --check-prefix=CHECK-ARM-CPU %s
77 // CHECK-ARM-CPU: "-target-cpu" "arm1176jzf-s"