blob: a9294362f6bab142738530a682abdb69174eaffa [file] [log] [blame]
Krzysztof Parzyszek45850682018-05-11 16:41:51 +00001// REQUIRES: hexagon-registered-target
2// RUN: %clang_cc1 -fsyntax-only -triple hexagon-unknown-elf -verify %s
3
4int foo(int x) {
Chandler Carruth16e6bc22018-06-21 23:46:09 +00005 // expected-error-re@+2 {{argument value {{.*}} is outside the valid range}}
6 // expected-error-re@+1 {{argument value {{.*}} is outside the valid range}}
Krzysztof Parzyszek45850682018-05-11 16:41:51 +00007 return __builtin_HEXAGON_S4_extract(x, 33, -1) +
Chandler Carruth16e6bc22018-06-21 23:46:09 +00008 // expected-error-re@+1 {{argument value {{.*}} is outside the valid range}}
Krzysztof Parzyszek45850682018-05-11 16:41:51 +00009 __builtin_HEXAGON_S4_extract(x, 3, 91) +
Chandler Carruth16e6bc22018-06-21 23:46:09 +000010 // expected-error-re@+2 {{argument value {{.*}} is outside the valid range}}
11 // expected-error-re@+1 {{argument value {{.*}} is outside the valid range}}
Krzysztof Parzyszek45850682018-05-11 16:41:51 +000012 __builtin_HEXAGON_S4_extract(x, -1, 35) +
13 __builtin_HEXAGON_S4_extract(x, 0, 31) +
14 __builtin_HEXAGON_S4_extract(x, 31, 0);
15}
16
17int bar(void *p, void *q, int x) {
18 // expected-error@+1 {{argument should be a multiple of 4}}
19 return __builtin_HEXAGON_L2_loadri_pci(p, -1, x, q) +
Chandler Carruth16e6bc22018-06-21 23:46:09 +000020 // expected-error-re@+2 {{argument value {{.*}} is outside the valid range}}
Krzysztof Parzyszek45850682018-05-11 16:41:51 +000021 // expected-error@+1 {{argument should be a multiple of 4}}
22 __builtin_HEXAGON_L2_loadri_pci(p, -99, x, q) +
Chandler Carruth16e6bc22018-06-21 23:46:09 +000023 // expected-error-re@+1 {{argument value {{.*}} is outside the valid range}}
Krzysztof Parzyszek45850682018-05-11 16:41:51 +000024 __builtin_HEXAGON_L2_loadri_pci(p, -132, x, q) +
25 __builtin_HEXAGON_L2_loadri_pci(p, 28, x, q) +
Chandler Carruth16e6bc22018-06-21 23:46:09 +000026 // expected-error-re@+2 {{argument value {{.*}} is outside the valid range}}
Krzysztof Parzyszek45850682018-05-11 16:41:51 +000027 // expected-error@+1 {{argument should be a multiple of 4}}
28 __builtin_HEXAGON_L2_loadri_pci(p, 29, x, q);
29}
30