Chandler Carruth | a6b2581 | 2012-11-21 23:40:23 +0000 | [diff] [blame] | 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 | // |
Rafael Espindola | 8af669f | 2012-06-19 01:26:10 +0000 | [diff] [blame] | 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 \ |
Chandler Carruth | a6b2581 | 2012-11-21 23:40:23 +0000 | [diff] [blame] | 10 | // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s |
| 11 | // |
| 12 | // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ |
| 13 | // RUN: -fno-use-init-array \ |
| 14 | // RUN: -target i386-unknown-linux \ |
| 15 | // RUN: --sysroot=%S/Inputs/fake_install_tree \ |
| 16 | // RUN: | FileCheck --check-prefix=CHECK-NO-INIT-ARRAY %s |
| 17 | // |
| 18 | // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ |
| 19 | // RUN: -fno-use-init-array -fuse-init-array \ |
| 20 | // RUN: -target i386-unknown-linux \ |
| 21 | // RUN: --sysroot=%S/Inputs/fake_install_tree \ |
| 22 | // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s |
| 23 | // |
Rafael Espindola | 8af669f | 2012-06-19 01:26:10 +0000 | [diff] [blame] | 24 | // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ |
| 25 | // RUN: -target i386-unknown-linux \ |
| 26 | // RUN: --sysroot=%S/Inputs/basic_linux_tree \ |
Chandler Carruth | a6b2581 | 2012-11-21 23:40:23 +0000 | [diff] [blame] | 27 | // RUN: | FileCheck --check-prefix=CHECK-NO-INIT-ARRAY %s |
| 28 | // |
| 29 | // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ |
| 30 | // RUN: -fuse-init-array \ |
| 31 | // RUN: -target i386-unknown-linux \ |
| 32 | // RUN: --sysroot=%S/Inputs/basic_linux_tree \ |
| 33 | // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s |
| 34 | // |
Logan Chien | 18c2842 | 2012-11-19 11:45:31 +0000 | [diff] [blame] | 35 | // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ |
| 36 | // RUN: -target arm-unknown-linux-androideabi \ |
| 37 | // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ |
Chandler Carruth | a6b2581 | 2012-11-21 23:40:23 +0000 | [diff] [blame] | 38 | // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s |
| 39 | // |
Logan Chien | 18c2842 | 2012-11-19 11:45:31 +0000 | [diff] [blame] | 40 | // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ |
| 41 | // RUN: -target mipsel-unknown-linux-android \ |
| 42 | // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ |
Chandler Carruth | a6b2581 | 2012-11-21 23:40:23 +0000 | [diff] [blame] | 43 | // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s |
| 44 | // |
Logan Chien | 18c2842 | 2012-11-19 11:45:31 +0000 | [diff] [blame] | 45 | // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ |
| 46 | // RUN: -target i386-unknown-linux-android \ |
| 47 | // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \ |
Chandler Carruth | a6b2581 | 2012-11-21 23:40:23 +0000 | [diff] [blame] | 48 | // RUN: | FileCheck --check-prefix=CHECK-INIT-ARRAY %s |