1 // Check behaviour of -fvisibility-from-dllstorageclass options
2 
3 // RUN: %clang -target x86_64-unknown-windows-itanium -fdeclspec \
4 // RUN:     -Werror -S -### %s 2>&1 | \
5 // RUN:   FileCheck %s \
6 // RUN:     --implicit-check-not=-fvisibility-from-dllstorageclass \
7 // RUN:     --implicit-check-not=-fvisibility-dllexport \
8 // RUN:     --implicit-check-not=-fvisibility-nodllstorageclass \
9 // RUN:     --implicit-check-not=-fvisibility-externs-dllimport \
10 // RUN:     --implicit-check-not=-fvisibility-externs-nodllstorageclass
11 
12 // RUN: %clang -target x86_64-unknown-windows-itanium -fdeclspec \
13 // RUN:     -fvisibility-from-dllstorageclass \
14 // RUN:     -fno-visibility-from-dllstorageclass \
15 // RUN:     -Werror -S -### %s 2>&1 | \
16 // RUN:   FileCheck %s \
17 // RUN:     --implicit-check-not=-fvisibility-from-dllstorageclass \
18 // RUN:     --implicit-check-not=-fvisibility-dllexport \
19 // RUN:     --implicit-check-not=-fvisibility-nodllstorageclass \
20 // RUN:     --implicit-check-not=-fvisibility-externs-dllimport \
21 // RUN:     --implicit-check-not=-fvisibility-externs-nodllstorageclass
22 
23 // RUN: %clang -target x86_64-unknown-windows-itanium -fdeclspec \
24 // RUN:     -fno-visibility-from-dllstorageclass \
25 // RUN:     -fvisibility-from-dllstorageclass \
26 // RUN:     -Werror -S -### %s 2>&1 | \
27 // RUN:   FileCheck %s --check-prefix=SET \
28 // RUN:     --implicit-check-not=-fvisibility-from-dllstorageclass \
29 // RUN:     --implicit-check-not=-fvisibility-dllexport \
30 // RUN:     --implicit-check-not=-fvisibility-nodllstorageclass \
31 // RUN:     --implicit-check-not=-fvisibility-externs-dllimport \
32 // RUN:     --implicit-check-not=-fvisibility-externs-nodllstorageclass
33 
34 // RUN: %clang -target x86_64-unknown-windows-itanium -fdeclspec \
35 // RUN:     -fvisibility-dllexport=hidden \
36 // RUN:     -fvisibility-nodllstorageclass=protected \
37 // RUN:     -fvisibility-externs-dllimport=hidden \
38 // RUN:     -fvisibility-externs-nodllstorageclass=protected \
39 // RUN:     -S -### %s 2>&1 | \
40 // RUN:   FileCheck %s --check-prefixes=UNUSED \
41 // RUN:     --implicit-check-not=-fvisibility-from-dllstorageclass \
42 // RUN:     --implicit-check-not=-fvisibility-dllexport \
43 // RUN:     --implicit-check-not=-fvisibility-nodllstorageclass \
44 // RUN:     --implicit-check-not=-fvisibility-externs-dllimport \
45 // RUN:     --implicit-check-not=-fvisibility-externs-nodllstorageclass \
46 // RUN:     --implicit-check-not=error: \
47 // RUN:     --implicit-check-not=warning:
48 
49 // RUN: %clang -target x86_64-unknown-windows-itanium -fdeclspec \
50 // RUN:     -fno-visibility-from-dllstorageclass \
51 // RUN:     -fvisibility-dllexport=hidden \
52 // RUN:     -fvisibility-nodllstorageclass=protected \
53 // RUN:     -fvisibility-externs-dllimport=hidden \
54 // RUN:     -fvisibility-externs-nodllstorageclass=protected \
55 // RUN:     -S -### %s 2>&1 | \
56 // RUN:   FileCheck %s --check-prefixes=UNUSED \
57 // RUN:     --implicit-check-not=-fvisibility-from-dllstorageclass \
58 // RUN:     --implicit-check-not=-fvisibility-dllexport \
59 // RUN:     --implicit-check-not=-fvisibility-nodllstorageclass \
60 // RUN:     --implicit-check-not=-fvisibility-externs-dllimport \
61 // RUN:     --implicit-check-not=-fvisibility-externs-nodllstorageclass \
62 // RUN:     --implicit-check-not=error: \
63 // RUN:     --implicit-check-not=warning:
64 
65 // UNUSED:      warning: argument unused during compilation: '-fvisibility-dllexport=hidden'
66 // UNUSED-NEXT: warning: argument unused during compilation: '-fvisibility-nodllstorageclass=protected'
67 // UNUSED-NEXT: warning: argument unused during compilation: '-fvisibility-externs-dllimport=hidden'
68 // UNUSED-NEXT: warning: argument unused during compilation: '-fvisibility-externs-nodllstorageclass=protected'
69 
70 // RUN: %clang -target x86_64-unknown-windows-itanium -fdeclspec \
71 // RUN:     -fvisibility-from-dllstorageclass \
72 // RUN:     -fvisibility-dllexport=default \
73 // RUN:     -fvisibility-dllexport=hidden \
74 // RUN:     -fvisibility-nodllstorageclass=default \
75 // RUN:     -fvisibility-nodllstorageclass=protected \
76 // RUN:     -fvisibility-externs-dllimport=default \
77 // RUN:     -fvisibility-externs-dllimport=hidden \
78 // RUN:     -fvisibility-externs-nodllstorageclass=default \
79 // RUN:     -fvisibility-externs-nodllstorageclass=protected \
80 // RUN:     -Werror -S -### %s 2>&1 | \
81 // RUN:   FileCheck %s --check-prefixes=SET,ALL
82 
83 // SET:      "-fvisibility-from-dllstorageclass"
84 // ALL-SAME: "-fvisibility-dllexport=hidden"
85 // ALL-SAME: "-fvisibility-nodllstorageclass=protected"
86 // ALL-SAME: "-fvisibility-externs-dllimport=hidden"
87 // ALL-SAME: "-fvisibility-externs-nodllstorageclass=protected"
88