1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 3
2 // REQUIRES: riscv-registered-target
3 // RUN: %clang_cc1 -triple riscv32 -O2 -emit-llvm %s -o - \
5 // RUN: %clang_cc1 -triple riscv64 -O2 -emit-llvm %s -o - \
8 // Test RISC-V specific clobbered registers in inline assembly.
10 // CHECK-LABEL: define {{.*}} void @test_fflags
11 // CHECK: tail call void asm sideeffect "", "~{fflags}"()
12 void test_fflags(void) {
13 asm volatile ("" :::"fflags");
16 // CHECK-LABEL: define {{.*}} void @test_frm
17 // CHECK: tail call void asm sideeffect "", "~{frm}"()
19 asm volatile ("" :::"frm");
22 // CHECK-LABEL: define {{.*}} void @test_vtype
23 // CHECK: tail call void asm sideeffect "", "~{vtype}"()
24 void test_vtype(void) {
25 asm volatile ("" :::"vtype");
28 // CHECK-LABEL: define {{.*}} void @test_vl
29 // CHECK: tail call void asm sideeffect "", "~{vl}"()
31 asm volatile ("" :::"vl");
34 // CHECK-LABEL: define {{.*}} void @test_vxsat
35 // CHECK: tail call void asm sideeffect "", "~{vxsat}"()
36 void test_vxsat(void) {
37 asm volatile ("" :::"vxsat");
40 // CHECK-LABEL: define {{.*}} void @test_vxrm
41 // CHECK: tail call void asm sideeffect "", "~{vxrm}"()
42 void test_vxrm(void) {
43 asm volatile ("" :::"vxrm");