1f4a2713aSLionel Sambuc // Test whether or not the driver instructs the backend to use .init_array 2f4a2713aSLionel Sambuc // sections for global constructors. 3f4a2713aSLionel Sambuc // 4f4a2713aSLionel Sambuc // CHECK-INIT-ARRAY: -fuse-init-array 5f4a2713aSLionel Sambuc // CHECK-NO-INIT-ARRAY-NOT: -fuse-init-array 6f4a2713aSLionel Sambuc // 7f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 8f4a2713aSLionel Sambuc // RUN: -target i386-unknown-linux \ 9f4a2713aSLionel Sambuc // RUN: --sysroot=%S/Inputs/fake_install_tree \ 10*0a6a1f1dSLionel Sambuc // RUN: --gcc-toolchain="" \ 11f4a2713aSLionel Sambuc // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s 12f4a2713aSLionel Sambuc // 13f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 14f4a2713aSLionel Sambuc // RUN: -fno-use-init-array \ 15f4a2713aSLionel Sambuc // RUN: -target i386-unknown-linux \ 16f4a2713aSLionel Sambuc // RUN: --sysroot=%S/Inputs/fake_install_tree \ 17*0a6a1f1dSLionel Sambuc // RUN: --gcc-toolchain="" \ 18f4a2713aSLionel Sambuc // RUN: | FileCheck --check-prefix=CHECK-NO-INIT-ARRAY %s 19f4a2713aSLionel Sambuc // 20f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 21f4a2713aSLionel Sambuc // RUN: -fno-use-init-array -fuse-init-array \ 22f4a2713aSLionel Sambuc // RUN: -target i386-unknown-linux \ 23f4a2713aSLionel Sambuc // RUN: --sysroot=%S/Inputs/fake_install_tree \ 24*0a6a1f1dSLionel Sambuc // RUN: --gcc-toolchain="" \ 25f4a2713aSLionel Sambuc // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s 26f4a2713aSLionel Sambuc // 27f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 28f4a2713aSLionel Sambuc // RUN: -target i386-unknown-linux \ 29f4a2713aSLionel Sambuc // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 30*0a6a1f1dSLionel Sambuc // RUN: --gcc-toolchain="" \ 31f4a2713aSLionel Sambuc // RUN: | FileCheck --check-prefix=CHECK-NO-INIT-ARRAY %s 32f4a2713aSLionel Sambuc // 33f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 34f4a2713aSLionel Sambuc // RUN: -fuse-init-array \ 35f4a2713aSLionel Sambuc // RUN: -target i386-unknown-linux \ 36f4a2713aSLionel Sambuc // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 37*0a6a1f1dSLionel Sambuc // RUN: --gcc-toolchain="" \ 38f4a2713aSLionel Sambuc // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s 39f4a2713aSLionel Sambuc // 40f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 41f4a2713aSLionel Sambuc // RUN: -target arm-unknown-linux-androideabi \ 42f4a2713aSLionel Sambuc // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 43*0a6a1f1dSLionel Sambuc // RUN: --gcc-toolchain="" \ 44f4a2713aSLionel Sambuc // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s 45f4a2713aSLionel Sambuc // 46f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 47f4a2713aSLionel Sambuc // RUN: -target mipsel-unknown-linux-android \ 48f4a2713aSLionel Sambuc // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 49*0a6a1f1dSLionel Sambuc // RUN: --gcc-toolchain="" \ 50f4a2713aSLionel Sambuc // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s 51f4a2713aSLionel Sambuc // 52f4a2713aSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 53f4a2713aSLionel Sambuc // RUN: -target i386-unknown-linux-android \ 54f4a2713aSLionel Sambuc // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ 55*0a6a1f1dSLionel Sambuc // RUN: --gcc-toolchain="" \ 56*0a6a1f1dSLionel Sambuc // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s 57*0a6a1f1dSLionel Sambuc // 58*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 59*0a6a1f1dSLionel Sambuc // RUN: -target aarch64-none-linux-gnu \ 60*0a6a1f1dSLionel Sambuc // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 61*0a6a1f1dSLionel Sambuc // RUN: --gcc-toolchain="" \ 62*0a6a1f1dSLionel Sambuc // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s 63*0a6a1f1dSLionel Sambuc // 64*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 65*0a6a1f1dSLionel Sambuc // RUN: -target aarch64-none-none-eabi \ 66*0a6a1f1dSLionel Sambuc // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s 67*0a6a1f1dSLionel Sambuc 68*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 69*0a6a1f1dSLionel Sambuc // RUN: -target arm64-none-linux-gnu \ 70*0a6a1f1dSLionel Sambuc // RUN: --sysroot=%S/Inputs/basic_linux_tree \ 71*0a6a1f1dSLionel Sambuc // RUN: --gcc-toolchain="" \ 72*0a6a1f1dSLionel Sambuc // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s 73*0a6a1f1dSLionel Sambuc // 74*0a6a1f1dSLionel Sambuc // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 75*0a6a1f1dSLionel Sambuc // RUN: -target arm64-none-none-eabi \ 76f4a2713aSLionel Sambuc // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s 77