Previously, this flag to CC1 was never exposed at the clang driver layer, and if you happened to enable it (by being on Android or GCC 4.7 platform), you couldn't *disable* it, because there was no 'no' variant. The whole thing was confusingly implemented. Now, the target-specific flag processing gets the driver arg list, and we use standard hasFlag with a default based on the GCC version and/or Android platform. The user can still pass the 'no-' variant to forcibly disable the flag, or pass the positive variant to clang itself to enable the flag. The test has also been substantially cleaned up and extended to cover these use cases. llvm-svn: 168473
49 lines
2.1 KiB
C
49 lines
2.1 KiB
C
// Test whether or not the driver instructs the backend to use .init_array
|
|
// sections for global constructors.
|
|
//
|
|
// CHECK-INIT-ARRAY: -fuse-init-array
|
|
// CHECK-NO-INIT-ARRAY-NOT: -fuse-init-array
|
|
//
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
// RUN: -target i386-unknown-linux \
|
|
// RUN: --sysroot=%S/Inputs/fake_install_tree \
|
|
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
|
|
//
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
// RUN: -fno-use-init-array \
|
|
// RUN: -target i386-unknown-linux \
|
|
// RUN: --sysroot=%S/Inputs/fake_install_tree \
|
|
// RUN: | FileCheck --check-prefix=CHECK-NO-INIT-ARRAY %s
|
|
//
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
// RUN: -fno-use-init-array -fuse-init-array \
|
|
// RUN: -target i386-unknown-linux \
|
|
// RUN: --sysroot=%S/Inputs/fake_install_tree \
|
|
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
|
|
//
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
// RUN: -target i386-unknown-linux \
|
|
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
|
|
// RUN: | FileCheck --check-prefix=CHECK-NO-INIT-ARRAY %s
|
|
//
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
// RUN: -fuse-init-array \
|
|
// RUN: -target i386-unknown-linux \
|
|
// RUN: --sysroot=%S/Inputs/basic_linux_tree \
|
|
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
|
|
//
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
// RUN: -target arm-unknown-linux-androideabi \
|
|
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
|
|
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
|
|
//
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
// RUN: -target mipsel-unknown-linux-android \
|
|
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
|
|
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
|
|
//
|
|
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
|
|
// RUN: -target i386-unknown-linux-android \
|
|
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
|
|
// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
|