Krzysztof Parzyszek | 4585068 | 2018-05-11 16:41:51 +0000 | [diff] [blame] | 1 | // REQUIRES: hexagon-registered-target |
| 2 | // RUN: %clang_cc1 -fsyntax-only -triple hexagon-unknown-elf -verify %s |
| 3 | |
| 4 | int foo(int x) { |
Chandler Carruth | 16e6bc2 | 2018-06-21 23:46:09 +0000 | [diff] [blame] | 5 | // expected-error-re@+2 {{argument value {{.*}} is outside the valid range}} |
| 6 | // expected-error-re@+1 {{argument value {{.*}} is outside the valid range}} |
Krzysztof Parzyszek | 4585068 | 2018-05-11 16:41:51 +0000 | [diff] [blame] | 7 | return __builtin_HEXAGON_S4_extract(x, 33, -1) + |
Chandler Carruth | 16e6bc2 | 2018-06-21 23:46:09 +0000 | [diff] [blame] | 8 | // expected-error-re@+1 {{argument value {{.*}} is outside the valid range}} |
Krzysztof Parzyszek | 4585068 | 2018-05-11 16:41:51 +0000 | [diff] [blame] | 9 | __builtin_HEXAGON_S4_extract(x, 3, 91) + |
Chandler Carruth | 16e6bc2 | 2018-06-21 23:46:09 +0000 | [diff] [blame] | 10 | // expected-error-re@+2 {{argument value {{.*}} is outside the valid range}} |
| 11 | // expected-error-re@+1 {{argument value {{.*}} is outside the valid range}} |
Krzysztof Parzyszek | 4585068 | 2018-05-11 16:41:51 +0000 | [diff] [blame] | 12 | __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 | |
| 17 | int 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 Carruth | 16e6bc2 | 2018-06-21 23:46:09 +0000 | [diff] [blame] | 20 | // expected-error-re@+2 {{argument value {{.*}} is outside the valid range}} |
Krzysztof Parzyszek | 4585068 | 2018-05-11 16:41:51 +0000 | [diff] [blame] | 21 | // expected-error@+1 {{argument should be a multiple of 4}} |
| 22 | __builtin_HEXAGON_L2_loadri_pci(p, -99, x, q) + |
Chandler Carruth | 16e6bc2 | 2018-06-21 23:46:09 +0000 | [diff] [blame] | 23 | // expected-error-re@+1 {{argument value {{.*}} is outside the valid range}} |
Krzysztof Parzyszek | 4585068 | 2018-05-11 16:41:51 +0000 | [diff] [blame] | 24 | __builtin_HEXAGON_L2_loadri_pci(p, -132, x, q) + |
| 25 | __builtin_HEXAGON_L2_loadri_pci(p, 28, x, q) + |
Chandler Carruth | 16e6bc2 | 2018-06-21 23:46:09 +0000 | [diff] [blame] | 26 | // expected-error-re@+2 {{argument value {{.*}} is outside the valid range}} |
Krzysztof Parzyszek | 4585068 | 2018-05-11 16:41:51 +0000 | [diff] [blame] | 27 | // expected-error@+1 {{argument should be a multiple of 4}} |
| 28 | __builtin_HEXAGON_L2_loadri_pci(p, 29, x, q); |
| 29 | } |
| 30 | |