| 1 |
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +v8a -verify -emit-llvm -o - %s |
| 2 |
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +d128 -verify=d128 -emit-llvm -o - %s |
| 3 |
|
| 4 |
// REQUIRES: aarch64-registered-target |
| 5 |
|
| 6 |
// Test that functions with the correct target attributes can use the correct |
| 7 |
// system-register intriniscs. |
| 8 |
|
| 9 |
// All the calls below are valid if you have -target-feature +d128 |
| 10 |
// d128-no-diagnostics |
| 11 |
|
| 12 |
#include <arm_acle.h> |
| 13 |
|
| 14 |
void anytarget(void) { |
| 15 |
unsigned x = __arm_rsr("1:2:3:4:5"); |
| 16 |
__arm_wsr("1:2:3:4:5", x); |
| 17 |
unsigned long y = __arm_rsr64("1:2:3:4:5"); |
| 18 |
__arm_wsr64("1:2:3:4:5", y); |
| 19 |
void *p = __arm_rsrp("1:2:3:4:5"); |
| 20 |
__arm_wsrp("1:2:3:4:5", p); |
| 21 |
} |
| 22 |
|
| 23 |
__attribute__((target("d128"))) |
| 24 |
void d128target(void) { |
| 25 |
__uint128_t x = __arm_rsr128("1:2:3:4:5"); |
| 26 |
__arm_wsr128("1:2:3:4:5", x); |
| 27 |
} |
| 28 |
|
| 29 |
void notd128target(void) { |
| 30 |
__uint128_t x = __arm_rsr128("1:2:3:4:5"); // expected-error {{needs target feature d128}} |
| 31 |
__arm_wsr128("1:2:3:4:5", x); // expected-error {{needs target feature d128}} |
| 32 |
} |