• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // 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 //
7 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1       \
8 // RUN:     -target i386-unknown-linux \
9 // RUN:     --sysroot=%S/Inputs/fake_install_tree \
10 // RUN:     --gcc-toolchain="" \
11 // 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 \
17 // RUN:     --gcc-toolchain="" \
18 // 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 \
24 // RUN:     --gcc-toolchain="" \
25 // RUN:   | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
26 //
27 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1       \
28 // RUN:     -target i386-unknown-linux \
29 // RUN:     --sysroot=%S/Inputs/basic_linux_tree \
30 // RUN:     --gcc-toolchain="" \
31 // 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 \
37 // RUN:     --gcc-toolchain="" \
38 // RUN:   | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
39 //
40 // 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 \
43 // RUN:     --gcc-toolchain="" \
44 // RUN:   | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
45 //
46 // 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 \
49 // RUN:     --gcc-toolchain="" \
50 // RUN:   | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
51 //
52 // 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 \
55 // RUN:     --gcc-toolchain="" \
56 // RUN:   | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
57 //
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 \
61 // RUN:     --gcc-toolchain="" \
62 // 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
67 
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 \
71 // RUN:     --gcc-toolchain="" \
72 // 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
77