Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Driver / dragonfly.c
blob11d730f55bd9d69fc3578dd3b02706e8617a8214
1 // RUN: %clang --target=x86_64-pc-dragonfly -### %s 2> %t.log
2 // RUN: FileCheck -input-file %t.log %s
4 // CHECK: "-cc1" "-triple" "x86_64-pc-dragonfly"
5 // CHECK: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/usr/libexec/ld-elf.so.{{.*}}" "--hash-style=gnu" "--enable-new-dtags" "-o" "a.out" "{{.*}}crt1.o" "{{.*}}crti.o" "{{.*}}crtbegin.o" "-L{{.*}}/../lib" "-L/usr/lib" "-L/usr/lib/gcc80" "{{.*}}.o" "-rpath" "{{.*}}gcc80{{.*}}" "-lc" "-lgcc" "{{.*}}crtend.o" "{{.*}}crtn.o"
7 // Check x86_64-unknown-dragonfly, X86_64
8 // RUN: %clang -### %s 2>&1 --target=x86_64-unknown-dragonfly \
9 // RUN: --gcc-toolchain="" \
10 // RUN: --sysroot=%S/Inputs/basic_dragonfly_tree \
11 // RUN: | FileCheck --check-prefix=CHECK-LD-X86_64 %s
12 // CHECK-LD-X86_64: "-cc1" "-triple" "x86_64-unknown-dragonfly"
13 // CHECK-LD-X86_64-SAME: "-isysroot" "[[SYSROOT:[^"]+]]"
14 // CHECK-LD-X86_64: "{{.*}}ld{{(.exe)?}}"
15 // CHECK-LD-X86_64-SAME: "[[SYSROOT]]{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crt1.o"
16 // CHECK-LD-X86_64-SAME: "[[SYSROOT]]{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crti.o"
17 // CHECK-LD-X86_64-SAME: "[[SYSROOT]]{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}gcc80{{/|\\\\}}crtbegin.o"
18 // CHECK-LD-X86_64-SAME: "-L[[SYSROOT]]{{/|\\\\}}usr{{/|\\\\}}lib" "-L[[SYSROOT]]{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}gcc80"
19 // CHECK-LD-X86_64-SAME: "-rpath" "/usr/lib/gcc80" "-lc" "-lgcc" "--as-needed" "-lgcc_pic" "--no-as-needed"
20 // CHECK-LD-X86_64-SAME: "[[SYSROOT]]{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}gcc80{{/|\\\\}}crtend.o"
21 // CHECK-LD-X86_64-SAME: "[[SYSROOT]]{{/|\\\\}}usr{{/|\\\\}}lib{{/|\\\\}}crtn.o"
23 // -r suppresses -dynamic-linker, default -l and crt*.o like -nostdlib.
24 // RUN: %clang -### %s --target=x86_64-pc-dragonfly -r \
25 // RUN: 2>&1 | FileCheck %s --check-prefix=RELOCATABLE
26 // RELOCATABLE: "-r"
27 // RELOCATABLE-NOT: "-dynamic-linker"
28 // RELOCATABLE-NOT: "-l
29 // RELOCATABLE-NOT: {{.*}}crt{{[^./]+}}.o
31 // Check that the new linker flags are passed to DragonFly
32 // RUN: %clang --target=x86_64-unknown-dragonfly -s -t -### %s 2>&1 \
33 // RUN: | FileCheck --check-prefix=CHECK-LD-FLAGS %s
34 // CHECK-LD-FLAGS: ld{{.*}}" "{{.*}}" "-s" "-t"