comparison clang/test/Driver/function-sections.c @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 1d019706d866
children
comparison
equal deleted inserted replaced
232:70dce7da266c 236:c4bab56944e8
4 // CHECK-NOFS-NOT: -ffunction-sections 4 // CHECK-NOFS-NOT: -ffunction-sections
5 // CHECK-DS: -fdata-sections 5 // CHECK-DS: -fdata-sections
6 // CHECK-NODS-NOT: -fdata-sections 6 // CHECK-NODS-NOT: -fdata-sections
7 // CHECK-US-NOT: -fno-unique-section-names 7 // CHECK-US-NOT: -fno-unique-section-names
8 // CHECK-NOUS: -fno-unique-section-names 8 // CHECK-NOUS: -fno-unique-section-names
9 // CHECK-PLUGIN-DEFAULT-NOT: "-plugin-opt=-function-sections
10 // CHECK-PLUGIN-DEFAULT-NOT: "-plugin-opt=-data-sections
11 // CHECK-PLUGIN-SECTIONS: "-plugin-opt=-function-sections=1"
12 // CHECK-PLUGIN-SECTIONS: "-plugin-opt=-data-sections=1"
13 // CHECK-PLUGIN-NO-SECTIONS: "-plugin-opt=-function-sections=0"
14 // CHECK-PLUGIN-NO-SECTIONS: "-plugin-opt=-data-sections=0"
9 15
10 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 16 // RUN: %clang -### %s -fsyntax-only 2>&1 \
11 // RUN: -target i386-unknown-linux \ 17 // RUN: --target=i386-unknown-linux \
12 // RUN: | FileCheck --check-prefix=CHECK-NOFS --check-prefix=CHECK-NODS %s 18 // RUN: | FileCheck --check-prefix=CHECK-NOFS --check-prefix=CHECK-NODS %s
13 19
14 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 20 // RUN: %clang -### %s -fsyntax-only 2>&1 \
15 // RUN: -target i386-unknown-linux \ 21 // RUN: --target=i386-unknown-linux \
16 // RUN: -ffunction-sections \ 22 // RUN: -ffunction-sections \
17 // RUN: | FileCheck --check-prefix=CHECK-FS %s 23 // RUN: | FileCheck --check-prefix=CHECK-FS %s
18 24
19 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 25 // RUN: %clang -### %s -fsyntax-only 2>&1 \
20 // RUN: -target i386-unknown-linux \ 26 // RUN: --target=i386-unknown-linux \
21 // RUN: -fno-function-sections \ 27 // RUN: -fno-function-sections \
22 // RUN: | FileCheck --check-prefix=CHECK-NOFS %s 28 // RUN: | FileCheck --check-prefix=CHECK-NOFS %s
23 29
24 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 30 // RUN: %clang -### %s -fsyntax-only 2>&1 \
25 // RUN: -target i386-unknown-linux \ 31 // RUN: --target=i386-unknown-linux \
26 // RUN: -ffunction-sections -fno-function-sections \ 32 // RUN: -ffunction-sections -fno-function-sections \
27 // RUN: | FileCheck --check-prefix=CHECK-NOFS %s 33 // RUN: | FileCheck --check-prefix=CHECK-NOFS %s
28 34
29 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 35 // RUN: %clang -### %s -fsyntax-only 2>&1 \
30 // RUN: -target i386-unknown-linux \ 36 // RUN: --target=i386-unknown-linux \
31 // RUN: -fno-function-sections -ffunction-sections \ 37 // RUN: -fno-function-sections -ffunction-sections \
32 // RUN: | FileCheck --check-prefix=CHECK-FS %s 38 // RUN: | FileCheck --check-prefix=CHECK-FS %s
33 39
34 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 40 // RUN: %clang -### %s -fsyntax-only 2>&1 \
35 // RUN: -target i386-unknown-linux \ 41 // RUN: --target=i386-unknown-linux \
36 // RUN: -ffunction-sections -fno-function-sections -ffunction-sections \ 42 // RUN: -ffunction-sections -fno-function-sections -ffunction-sections \
37 // RUN: | FileCheck --check-prefix=CHECK-FS %s 43 // RUN: | FileCheck --check-prefix=CHECK-FS %s
38 44
39 45
40 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 46 // RUN: %clang -### %s -fsyntax-only 2>&1 \
41 // RUN: -target i386-unknown-linux \ 47 // RUN: --target=i386-unknown-linux \
42 // RUN: -fdata-sections \ 48 // RUN: -fdata-sections \
43 // RUN: | FileCheck --check-prefix=CHECK-DS %s 49 // RUN: | FileCheck --check-prefix=CHECK-DS %s
44 50
45 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 51 // RUN: %clang -### %s -fsyntax-only 2>&1 \
46 // RUN: -target i386-unknown-linux \ 52 // RUN: --target=i386-unknown-linux \
47 // RUN: -fno-data-sections \ 53 // RUN: -fno-data-sections \
48 // RUN: | FileCheck --check-prefix=CHECK-NODS %s 54 // RUN: | FileCheck --check-prefix=CHECK-NODS %s
49 55
50 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 56 // RUN: %clang -### %s -fsyntax-only 2>&1 \
51 // RUN: -target i386-unknown-linux \ 57 // RUN: --target=i386-unknown-linux \
52 // RUN: -fdata-sections -fno-data-sections \ 58 // RUN: -fdata-sections -fno-data-sections \
53 // RUN: | FileCheck --check-prefix=CHECK-NODS %s 59 // RUN: | FileCheck --check-prefix=CHECK-NODS %s
54 60
55 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 61 // RUN: %clang -### %s -fsyntax-only 2>&1 \
56 // RUN: -target i386-unknown-linux \ 62 // RUN: --target=i386-unknown-linux \
57 // RUN: -fno-data-sections -fdata-sections \ 63 // RUN: -fno-data-sections -fdata-sections \
58 // RUN: | FileCheck --check-prefix=CHECK-DS %s 64 // RUN: | FileCheck --check-prefix=CHECK-DS %s
59 65
60 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 66 // RUN: %clang -### %s -fsyntax-only 2>&1 \
61 // RUN: -target i386-unknown-linux \ 67 // RUN: --target=i386-unknown-linux \
62 // RUN: -fdata-sections -fno-data-sections -fdata-sections \ 68 // RUN: -fdata-sections -fno-data-sections -fdata-sections \
63 // RUN: | FileCheck --check-prefix=CHECK-DS %s 69 // RUN: | FileCheck --check-prefix=CHECK-DS %s
64 70
65 71
66 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 72 // RUN: %clang -### %s -fsyntax-only 2>&1 \
67 // RUN: -target i386-unknown-linux \ 73 // RUN: --target=i386-unknown-linux \
68 // RUN: -funique-section-names \ 74 // RUN: -funique-section-names \
69 // RUN: | FileCheck --check-prefix=CHECK-US %s 75 // RUN: | FileCheck --check-prefix=CHECK-US %s
70 76
71 // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ 77 // RUN: %clang -### %s -fsyntax-only 2>&1 \
72 // RUN: -target i386-unknown-linux \ 78 // RUN: --target=i386-unknown-linux \
73 // RUN: -fno-unique-section-names \ 79 // RUN: -fno-unique-section-names \
74 // RUN: | FileCheck --check-prefix=CHECK-NOUS %s 80 // RUN: | FileCheck --check-prefix=CHECK-NOUS %s
81
82
83 // RUN: %clang -### %s -flto 2>&1 \
84 // RUN: --target=x86_64-unknown-linux \
85 // RUN: | FileCheck --check-prefix=CHECK-PLUGIN-DEFAULT %s
86
87 // RUN: %clang -### %s -flto 2>&1 \
88 // RUN: --target=x86_64-unknown-linux \
89 // RUN: -ffunction-sections -fdata-sections \
90 // RUN: | FileCheck --check-prefix=CHECK-PLUGIN-SECTIONS %s
91
92 // RUN: %clang -### %s -flto 2>&1 \
93 // RUN: --target=x86_64-unknown-linux \
94 // RUN: -fno-function-sections -fno-data-sections \
95 // RUN: | FileCheck --check-prefix=CHECK-PLUGIN-NO-SECTIONS %s