[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Driver / ppc-dependent-options.cpp
blob65c40e9ce70f657a758543b3d8fce524b02513b3
1 // REQUIRES: powerpc-registered-target
2 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
3 // RUN: -mcpu=power8 -std=c++11 %s 2>&1 | FileCheck %s \
4 // RUN: -check-prefix=CHECK-DEFAULT
6 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
7 // RUN: -mcpu=power8 -std=c++11 -mno-vsx -mpower8-vector %s 2>&1 | \
8 // RUN: FileCheck %s -check-prefix=CHECK-NVSX-P8V
10 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
11 // RUN: -mcpu=power8 -std=c++11 -mno-vsx -mdirect-move %s 2>&1 | FileCheck %s \
12 // RUN: -check-prefix=CHECK-NVSX-DMV
14 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
15 // RUN: -mcpu=power8 -std=c++11 -mno-vsx -mpower8-vector -mvsx %s 2>&1 | \
16 // RUN: FileCheck %s -check-prefix=CHECK-DEFAULT
18 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
19 // RUN: -mcpu=power8 -std=c++11 -mno-vsx -mdirect-move -mvsx %s 2>&1 | \
20 // RUN: FileCheck %s -check-prefix=CHECK-DEFAULT
22 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
23 // RUN: -mcpu=power8 -std=c++11 -mpower8-vector -mno-vsx %s 2>&1 | \
24 // RUN: FileCheck %s -check-prefix=CHECK-NVSX-P8V
26 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
27 // RUN: -mcpu=power8 -std=c++11 -mdirect-move -mno-vsx %s 2>&1 | FileCheck %s \
28 // RUN: -check-prefix=CHECK-NVSX-DMV
30 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
31 // RUN: -mcpu=power8 -std=c++11 -mno-vsx %s 2>&1 | FileCheck %s \
32 // RUN: -check-prefix=CHECK-NVSX
34 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
35 // RUN: -mcpu=power6 -std=c++11 %s 2>&1 | FileCheck %s -check-prefix=CHECK-NVSX
37 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
38 // RUN: -mcpu=power6 -std=c++11 -mpower8-vector %s 2>&1 | FileCheck %s \
39 // RUN: -check-prefix=CHECK-DEFAULT
41 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
42 // RUN: -mcpu=power6 -std=c++11 -mdirect-move %s 2>&1 | FileCheck %s \
43 // RUN: -check-prefix=CHECK-VSX
45 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
46 // RUN: -mcpu=power9 -std=c++11 %s 2>&1 | FileCheck %s \
47 // RUN: -check-prefix=CHECK-DEFAULT-P9
49 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
50 // RUN: -mcpu=power9 -std=c++11 -mno-vsx -mpower9-vector %s 2>&1 | \
51 // RUN: FileCheck %s -check-prefix=CHECK-NVSX-P9V
53 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
54 // RUN: -mcpu=power9 -std=c++11 -mno-vsx -mfloat128 %s 2>&1 | \
55 // RUN: FileCheck %s -check-prefix=CHECK-NVSX-FLT128
57 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
58 // RUN: -mcpu=power10 -std=c++11 -mno-vsx -mpaired-vector-memops %s 2>&1 | \
59 // RUN: FileCheck %s -check-prefix=CHECK-NVSX-PAIRED-VEC-MEMOPS
61 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
62 // RUN: -mcpu=power10 -std=c++11 -mno-vsx -mmma %s 2>&1 | \
63 // RUN: FileCheck %s -check-prefix=CHECK-NVSX-MMA
65 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
66 // RUN: -mcpu=future -std=c++11 -mno-vsx -mmma %s 2>&1 | \
67 // RUN: FileCheck %s -check-prefix=CHECK-NVSX-MMA
69 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
70 // RUN: -mcpu=power9 -std=c++11 -mno-vsx -mfloat128 -mpower9-vector %s 2>&1 | \
71 // RUN: FileCheck %s -check-prefix=CHECK-NVSX-MULTI
73 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
74 // RUN: -mcpu=power10 -std=c++11 %s 2>&1 | FileCheck %s \
75 // RUN: -check-prefix=CHECK-DEFAULT-P10
77 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
78 // RUN: -mcpu=power10 -std=c++11 -mno-vsx -mpower10-vector %s 2>&1 | \
79 // RUN: FileCheck %s -check-prefix=CHECK-NVSX-P10V
81 #ifdef __VSX__
82 static_assert(false, "VSX enabled");
83 #endif
85 #ifdef __POWER8_VECTOR__
86 static_assert(false, "P8V enabled");
87 #endif
89 #ifdef __POWER9_VECTOR__
90 static_assert(false, "P9V enabled");
91 #endif
93 #ifdef __POWER10_VECTOR__
94 static_assert(false, "P10V enabled");
95 #endif
97 #if !defined(__VSX__) && !defined(__POWER8_VECTOR__) && \
98 !defined(__POWER9_VECTOR__)
99 static_assert(false, "Neither enabled");
100 #endif
102 // CHECK-DEFAULT: VSX enabled
103 // CHECK-DEFAULT: P8V enabled
104 // CHECK-DEFAULT-P9: P9V enabled
105 // CHECK-DEFAULT-P10: P10V enabled
106 // CHECK-NVSX-P8V: error: option '-mpower8-vector' cannot be specified with '-mno-vsx'
107 // CHECK-NVSX-P9V: error: option '-mpower9-vector' cannot be specified with '-mno-vsx'
108 // CHECK-NVSX-P10V: error: option '-mpower10-vector' cannot be specified with '-mno-vsx'
109 // CHECK-NVSX-FLT128: error: option '-mfloat128' cannot be specified with '-mno-vsx'
110 // CHECK-NVSX-DMV: error: option '-mdirect-move' cannot be specified with '-mno-vsx'
111 // CHECK-NVSX-PAIRED-VEC-MEMOPS: error: option '-mpaired-vector-memops' cannot be specified with '-mno-vsx'
112 // CHECK-NVSX-MULTI: error: option '-mfloat128' cannot be specified with '-mno-vsx'
113 // CHECK-NVSX-MULTI: error: option '-mpower9-vector' cannot be specified with '-mno-vsx'
114 // CHECK-NVSX-MMA: error: option '-mmma' cannot be specified with '-mno-vsx'
115 // CHECK-NVSX: Neither enabled
116 // CHECK-VSX: VSX enabled