33 lines · c
1// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +v8a -verify -emit-llvm -o - %s2// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +d128 -verify=d128 -emit-llvm -o - %s3 4// REQUIRES: aarch64-registered-target5 6// Test that functions with the correct target attributes can use the correct7// system-register intriniscs.8 9// All the calls below are valid if you have -target-feature +d12810// d128-no-diagnostics11 12#include <arm_acle.h>13 14void 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")))24void d128target(void) {25 __uint128_t x = __arm_rsr128("1:2:3:4:5");26 __arm_wsr128("1:2:3:4:5", x);27}28 29void 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}33