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
5 
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
9 
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
13 
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
17 
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
21 
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
25 
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
29 
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
33 
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
36 
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
40 
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
44 
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
48 
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
52 
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
56 
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
60 
61 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
62 // RUN: -mcpu=power9 -std=c++11 -mno-vsx -mfloat128 -mpower9-vector %s 2>&1 | \
63 // RUN: FileCheck %s -check-prefix=CHECK-NVSX-MULTI
64 
65 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
66 // RUN: -mcpu=power10 -std=c++11 %s 2>&1 | FileCheck %s \
67 // RUN: -check-prefix=CHECK-DEFAULT-P10
68 
69 // RUN: not %clang -target powerpc64le-unknown-unknown -fsyntax-only \
70 // RUN: -mcpu=power10 -std=c++11 -mno-vsx -mpower10-vector %s 2>&1 | \
71 // RUN: FileCheck %s -check-prefix=CHECK-NVSX-P10V
72 
73 #ifdef __VSX__
74 static_assert(false, "VSX enabled");
75 #endif
76 
77 #ifdef __POWER8_VECTOR__
78 static_assert(false, "P8V enabled");
79 #endif
80 
81 #ifdef __POWER9_VECTOR__
82 static_assert(false, "P9V enabled");
83 #endif
84 
85 #ifdef __POWER10_VECTOR__
86 static_assert(false, "P10V enabled");
87 #endif
88 
89 #if !defined(__VSX__) && !defined(__POWER8_VECTOR__) && \
90     !defined(__POWER9_VECTOR__)
91 static_assert(false, "Neither enabled");
92 #endif
93 
94 // CHECK-DEFAULT: VSX enabled
95 // CHECK-DEFAULT: P8V enabled
96 // CHECK-DEFAULT-P9: P9V enabled
97 // CHECK-DEFAULT-P10: P10V enabled
98 // CHECK-NVSX-P8V: error: option '-mpower8-vector' cannot be specified with '-mno-vsx'
99 // CHECK-NVSX-P9V: error: option '-mpower9-vector' cannot be specified with '-mno-vsx'
100 // CHECK-NVSX-P10V: error: option '-mpower10-vector' cannot be specified with '-mno-vsx'
101 // CHECK-NVSX-FLT128: error: option '-mfloat128' cannot be specified with '-mno-vsx'
102 // CHECK-NVSX-DMV: error: option '-mdirect-move' cannot be specified with '-mno-vsx'
103 // CHECK-NVSX-PAIRED-VEC-MEMOPS: error: option '-mpaired-vector-memops' cannot be specified with '-mno-vsx'
104 // CHECK-NVSX-MULTI: error: option '-mfloat128' cannot be specified with '-mno-vsx'
105 // CHECK-NVSX-MULTI: error: option '-mpower9-vector' cannot be specified with '-mno-vsx'
106 // CHECK-NVSX: Neither enabled
107 // CHECK-VSX: VSX enabled
108