brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 69ba3be Raw
42 lines · c
1// RUN: %clang_cc1 %s -triple riscv32 -verify -fsyntax-only2// RUN: %clang_cc1 %s -triple riscv64 -verify -fsyntax-only3 4void i (void) {5  asm volatile ("" ::: "x0",  "x1",  "x2",  "x3",  "x4",  "x5",  "x6",  "x7");6  asm volatile ("" ::: "x8",  "x9",  "x10", "x11", "x12", "x13", "x14", "x15");7  asm volatile ("" ::: "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23");8  asm volatile ("" ::: "x24", "x25", "x26", "x27", "x28", "x29", "x30", "x31");9 10  asm volatile ("" ::: "zero", "ra", "sp",  "gp",  "tp", "t0", "t1", "t2");11  asm volatile ("" ::: "s0",   "s1", "a0",  "a1",  "a2", "a3", "a4", "a5");12  asm volatile ("" ::: "a6",   "a7", "s2",  "s3",  "s4", "s5", "s6", "s7");13  asm volatile ("" ::: "s8",   "s9", "s10", "s11", "t3", "t4", "t5", "t6");14}15 16void f (void) {17  asm volatile ("" ::: "f0",  "f1",  "f2",  "f3",  "f4",  "f5",  "f6",  "f7");18  asm volatile ("" ::: "f8",  "f9",  "f10", "f11", "f12", "f13", "f14", "f15");19  asm volatile ("" ::: "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23");20  asm volatile ("" ::: "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31");21 22  asm volatile ("" ::: "ft0", "ft1", "ft2",  "ft3",  "ft4", "ft5", "ft6",  "ft7");23  asm volatile ("" ::: "fs0", "fs1", "fa0",  "fa1",  "fa2", "fa3", "fa4",  "fa5");24  asm volatile ("" ::: "fa6", "fa7", "fs2",  "fs3",  "fs4", "fs5", "fs6",  "fs7");25  asm volatile ("" ::: "fs8", "fs9", "fs10", "fs11", "ft8", "ft9", "ft10", "ft11");26}27 28register char i1 __asm__ ("x1"); // expected-error {{size of register 'x1' does not match variable size}}29#if __riscv_xlen == 3230register long long ll2 __asm__ ("x2"); // expected-error {{size of register 'x2' does not match variable size}}31register int i2 __asm__ ("x3");32#endif33register long l3 __asm__ ("x4");34register long ra __asm__ ("ra");35register long sp __asm__ ("sp");36register int *gp __asm__ ("gp");37register char *tp __asm__ ("tp");38register long a7 __asm__ ("a7");39register long s11 __asm__ ("s11");40register long t5 __asm__ ("t5");41register long* f1 __asm__ ("f1"); // expected-error {{register 'f1' unsuitable for global register variables on this target}}42