[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Sema / builtins-ppc.c
bloba0550c72a7785b648adc190fa3e13a0d321401a2
1 // REQUIRES: powerpc-registered-target
2 // RUN: %clang_cc1 -target-feature +altivec -target-feature +htm \
3 // RUN: -triple powerpc64-unknown-unknown -DTEST_HTM -fsyntax-only \
4 // RUN: -verify %s
6 // RUN: %clang_cc1 -target-feature +altivec -target-feature +crypto \
7 // RUN: -triple powerpc64le-unknown-unknown -DTEST_CRYPTO -fsyntax-only \
8 // RUN: -verify %s
9 // RUN: %clang_cc1 -target-feature +altivec -target-feature +crypto \
10 // RUN: -triple powerpc64le-unknown-unknown -DTEST_CRYPTO -fsyntax-only \
11 // RUN: -target-feature +vsx -verify %s
13 #ifdef TEST_HTM
14 void test_htm() {
15 __builtin_tbegin(4); // expected-error-re {{argument value {{.*}} is outside the valid range}}
16 __builtin_tend(-1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
17 __builtin_tsr(55); // expected-error-re {{argument value {{.*}} is outside the valid range}}
18 __builtin_tabortwc(-5, 2, 3); // expected-error-re {{argument value {{.*}} is outside the valid range}}
19 __builtin_tabortdc(55, 2, 3); // expected-error-re {{argument value {{.*}} is outside the valid range}}
20 __builtin_tabortwci(-5, 2, 5); // expected-error-re {{argument value {{.*}} is outside the valid range}}
21 __builtin_tabortwci(5, 2, 55); // expected-error-re {{argument value {{.*}} is outside the valid range}}
22 __builtin_tabortdci(-5, 2, 5); // expected-error-re {{argument value {{.*}} is outside the valid range}}
23 __builtin_tabortdci(5, 2, 55); // expected-error-re {{argument value {{.*}} is outside the valid range}}
25 #endif
28 #ifdef TEST_CRYPTO
29 #include <altivec.h>
31 #define W_INIT { 0x01020304, 0x05060708, 0x090A0B0C, 0x0D0E0F10 };
32 #define D_INIT { 0x0102030405060708, 0x090A0B0C0D0E0F10 };
33 vector unsigned int test_vshasigmaw_or(void)
35 vector unsigned int a = W_INIT
36 vector unsigned int b = __builtin_crypto_vshasigmaw(a, 2, 15); // expected-error-re {{argument value {{.*}} is outside the valid range}}
37 vector unsigned int c = __builtin_crypto_vshasigmaw(a, -1, 15); // expected-error-re {{argument value {{.*}} is outside the valid range}}
38 vector unsigned int d = __builtin_crypto_vshasigmaw(a, 0, 85); // expected-error-re {{argument value {{.*}} is outside the valid range}}
39 vector unsigned int e = __builtin_crypto_vshasigmaw(a, 1, -15); // expected-error-re {{argument value {{.*}} is outside the valid range}}
40 return __builtin_crypto_vshasigmaw(a, 1, 15);
43 #ifdef __VSX__
44 vector unsigned long long test_vshasigmad_or(void)
46 vector unsigned long long a = D_INIT
47 vector unsigned long long b = __builtin_crypto_vshasigmad(a, 2, 15); // expected-error-re {{argument value {{.*}} is outside the valid range}}
48 vector unsigned long long c = __builtin_crypto_vshasigmad(a, -1, 15); // expected-error-re {{argument value {{.*}} is outside the valid range}}
49 vector unsigned long long d = __builtin_crypto_vshasigmad(a, 0, 85); // expected-error-re {{argument value {{.*}} is outside the valid range}}
50 vector unsigned long long e = __builtin_crypto_vshasigmad(a, 1, -15); // expected-error-re {{argument value {{.*}} is outside the valid range}}
51 return __builtin_crypto_vshasigmad(a, 0, 15);
53 #endif
55 #endif