blob: cd14ed736a28cbc271296fb1dc6eb0f5c3f2c3b4 [file] [log] [blame]
Chandler Carruth05fb5852012-11-21 23:40:23 +00001// Test whether or not the driver instructs the backend to use .init_array
2// sections for global constructors.
3//
4// CHECK-INIT-ARRAY: -fuse-init-array
5// CHECK-NO-INIT-ARRAY-NOT: -fuse-init-array
6//
Rafael Espindola66aa0452012-06-19 01:26:10 +00007// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
8// RUN: -target i386-unknown-linux \
9// RUN: --sysroot=%S/Inputs/fake_install_tree \
Samuel Antao4ae1f672015-01-05 17:07:42 +000010// RUN: --gcc-toolchain="" \
Chandler Carruth05fb5852012-11-21 23:40:23 +000011// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
12//
13// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
14// RUN: -fno-use-init-array \
15// RUN: -target i386-unknown-linux \
16// RUN: --sysroot=%S/Inputs/fake_install_tree \
Samuel Antao4ae1f672015-01-05 17:07:42 +000017// RUN: --gcc-toolchain="" \
Chandler Carruth05fb5852012-11-21 23:40:23 +000018// RUN: | FileCheck --check-prefix=CHECK-NO-INIT-ARRAY %s
19//
20// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
21// RUN: -fno-use-init-array -fuse-init-array \
22// RUN: -target i386-unknown-linux \
23// RUN: --sysroot=%S/Inputs/fake_install_tree \
Samuel Antao4ae1f672015-01-05 17:07:42 +000024// RUN: --gcc-toolchain="" \
Chandler Carruth05fb5852012-11-21 23:40:23 +000025// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
26//
Rafael Espindola66aa0452012-06-19 01:26:10 +000027// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
28// RUN: -target i386-unknown-linux \
29// RUN: --sysroot=%S/Inputs/basic_linux_tree \
Samuel Antao4ae1f672015-01-05 17:07:42 +000030// RUN: --gcc-toolchain="" \
Chandler Carruth05fb5852012-11-21 23:40:23 +000031// RUN: | FileCheck --check-prefix=CHECK-NO-INIT-ARRAY %s
32//
33// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
34// RUN: -fuse-init-array \
35// RUN: -target i386-unknown-linux \
36// RUN: --sysroot=%S/Inputs/basic_linux_tree \
Samuel Antao4ae1f672015-01-05 17:07:42 +000037// RUN: --gcc-toolchain="" \
Chandler Carruth05fb5852012-11-21 23:40:23 +000038// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
39//
Logan Chien1d8cc652012-11-19 11:45:31 +000040// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
41// RUN: -target arm-unknown-linux-androideabi \
42// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
Samuel Antao4ae1f672015-01-05 17:07:42 +000043// RUN: --gcc-toolchain="" \
Chandler Carruth05fb5852012-11-21 23:40:23 +000044// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
45//
Logan Chien1d8cc652012-11-19 11:45:31 +000046// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
47// RUN: -target mipsel-unknown-linux-android \
48// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
Samuel Antao4ae1f672015-01-05 17:07:42 +000049// RUN: --gcc-toolchain="" \
Chandler Carruth05fb5852012-11-21 23:40:23 +000050// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
51//
Logan Chien1d8cc652012-11-19 11:45:31 +000052// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
53// RUN: -target i386-unknown-linux-android \
54// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
Samuel Antao4ae1f672015-01-05 17:07:42 +000055// RUN: --gcc-toolchain="" \
Chandler Carruth05fb5852012-11-21 23:40:23 +000056// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
Kristof Beylsfb387292014-01-10 13:44:34 +000057//
58// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
59// RUN: -target aarch64-none-linux-gnu \
60// RUN: --sysroot=%S/Inputs/basic_linux_tree \
Samuel Antao4ae1f672015-01-05 17:07:42 +000061// RUN: --gcc-toolchain="" \
Kristof Beylsfb387292014-01-10 13:44:34 +000062// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
63//
64// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
65// RUN: -target aarch64-none-none-eabi \
66// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
James Molloy96061a62014-04-17 12:51:36 +000067
68// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
69// RUN: -target arm64-none-linux-gnu \
70// RUN: --sysroot=%S/Inputs/basic_linux_tree \
Samuel Antao4ae1f672015-01-05 17:07:42 +000071// RUN: --gcc-toolchain="" \
James Molloy96061a62014-04-17 12:51:36 +000072// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
73//
74// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
75// RUN: -target arm64-none-none-eabi \
76// RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s