342 lines · c
1// RUN: %clang --target=riscv32 -ffixed-x1 -### %s 2> %t2// RUN: FileCheck --check-prefix=CHECK-FIXED-X1 < %t %s3// RUN: %clang --target=riscv64 -ffixed-x1 -### %s 2> %t4// RUN: FileCheck --check-prefix=CHECK-FIXED-X1 < %t %s5// CHECK-FIXED-X1: "-target-feature" "+reserve-x1"6 7// RUN: %clang --target=riscv32 -ffixed-x2 -### %s 2> %t8// RUN: FileCheck --check-prefix=CHECK-FIXED-X2 < %t %s9// RUN: %clang --target=riscv64 -ffixed-x2 -### %s 2> %t10// RUN: FileCheck --check-prefix=CHECK-FIXED-X2 < %t %s11// CHECK-FIXED-X2: "-target-feature" "+reserve-x2"12 13// RUN: %clang --target=riscv32 -ffixed-x3 -### %s 2> %t14// RUN: FileCheck --check-prefix=CHECK-FIXED-X3 < %t %s15// RUN: %clang --target=riscv64 -ffixed-x3 -### %s 2> %t16// RUN: FileCheck --check-prefix=CHECK-FIXED-X3 < %t %s17// CHECK-FIXED-X3: "-target-feature" "+reserve-x3"18 19// RUN: %clang --target=riscv32 -ffixed-x4 -### %s 2> %t20// RUN: FileCheck --check-prefix=CHECK-FIXED-X4 < %t %s21// RUN: %clang --target=riscv64 -ffixed-x4 -### %s 2> %t22// RUN: FileCheck --check-prefix=CHECK-FIXED-X4 < %t %s23// CHECK-FIXED-X4: "-target-feature" "+reserve-x4"24 25// RUN: %clang --target=riscv32 -ffixed-x5 -### %s 2> %t26// RUN: FileCheck --check-prefix=CHECK-FIXED-X5 < %t %s27// RUN: %clang --target=riscv64 -ffixed-x5 -### %s 2> %t28// RUN: FileCheck --check-prefix=CHECK-FIXED-X5 < %t %s29// CHECK-FIXED-X5: "-target-feature" "+reserve-x5"30 31// RUN: %clang --target=riscv32 -ffixed-x6 -### %s 2> %t32// RUN: FileCheck --check-prefix=CHECK-FIXED-X6 < %t %s33// RUN: %clang --target=riscv64 -ffixed-x6 -### %s 2> %t34// RUN: FileCheck --check-prefix=CHECK-FIXED-X6 < %t %s35// CHECK-FIXED-X6: "-target-feature" "+reserve-x6"36 37// RUN: %clang --target=riscv32 -ffixed-x7 -### %s 2> %t38// RUN: FileCheck --check-prefix=CHECK-FIXED-X7 < %t %s39// RUN: %clang --target=riscv64 -ffixed-x7 -### %s 2> %t40// RUN: FileCheck --check-prefix=CHECK-FIXED-X7 < %t %s41// CHECK-FIXED-X7: "-target-feature" "+reserve-x7"42 43// RUN: %clang --target=riscv32 -ffixed-x8 -### %s 2> %t44// RUN: FileCheck --check-prefix=CHECK-FIXED-X8 < %t %s45// RUN: %clang --target=riscv64 -ffixed-x8 -### %s 2> %t46// RUN: FileCheck --check-prefix=CHECK-FIXED-X8 < %t %s47// CHECK-FIXED-X8: "-target-feature" "+reserve-x8"48 49// RUN: %clang --target=riscv32 -ffixed-x9 -### %s 2> %t50// RUN: FileCheck --check-prefix=CHECK-FIXED-X9 < %t %s51// RUN: %clang --target=riscv64 -ffixed-x9 -### %s 2> %t52// RUN: FileCheck --check-prefix=CHECK-FIXED-X9 < %t %s53// CHECK-FIXED-X9: "-target-feature" "+reserve-x9"54 55// RUN: %clang --target=riscv32 -ffixed-x10 -### %s 2> %t56// RUN: FileCheck --check-prefix=CHECK-FIXED-X10 < %t %s57// RUN: %clang --target=riscv64 -ffixed-x10 -### %s 2> %t58// RUN: FileCheck --check-prefix=CHECK-FIXED-X10 < %t %s59// CHECK-FIXED-X10: "-target-feature" "+reserve-x10"60 61// RUN: %clang --target=riscv32 -ffixed-x11 -### %s 2> %t62// RUN: FileCheck --check-prefix=CHECK-FIXED-X11 < %t %s63// RUN: %clang --target=riscv64 -ffixed-x11 -### %s 2> %t64// RUN: FileCheck --check-prefix=CHECK-FIXED-X11 < %t %s65// CHECK-FIXED-X11: "-target-feature" "+reserve-x11"66 67// RUN: %clang --target=riscv32 -ffixed-x12 -### %s 2> %t68// RUN: FileCheck --check-prefix=CHECK-FIXED-X12 < %t %s69// RUN: %clang --target=riscv64 -ffixed-x12 -### %s 2> %t70// RUN: FileCheck --check-prefix=CHECK-FIXED-X12 < %t %s71// CHECK-FIXED-X12: "-target-feature" "+reserve-x12"72 73// RUN: %clang --target=riscv32 -ffixed-x13 -### %s 2> %t74// RUN: FileCheck --check-prefix=CHECK-FIXED-X13 < %t %s75// RUN: %clang --target=riscv64 -ffixed-x13 -### %s 2> %t76// RUN: FileCheck --check-prefix=CHECK-FIXED-X13 < %t %s77// CHECK-FIXED-X13: "-target-feature" "+reserve-x13"78 79// RUN: %clang --target=riscv32 -ffixed-x14 -### %s 2> %t80// RUN: FileCheck --check-prefix=CHECK-FIXED-X14 < %t %s81// RUN: %clang --target=riscv64 -ffixed-x14 -### %s 2> %t82// RUN: FileCheck --check-prefix=CHECK-FIXED-X14 < %t %s83// CHECK-FIXED-X14: "-target-feature" "+reserve-x14"84 85// RUN: %clang --target=riscv32 -ffixed-x15 -### %s 2> %t86// RUN: FileCheck --check-prefix=CHECK-FIXED-X15 < %t %s87// RUN: %clang --target=riscv64 -ffixed-x15 -### %s 2> %t88// RUN: FileCheck --check-prefix=CHECK-FIXED-X15 < %t %s89// CHECK-FIXED-X15: "-target-feature" "+reserve-x15"90 91// RUN: %clang --target=riscv32 -ffixed-x16 -### %s 2> %t92// RUN: FileCheck --check-prefix=CHECK-FIXED-X16 < %t %s93// RUN: %clang --target=riscv64 -ffixed-x16 -### %s 2> %t94// RUN: FileCheck --check-prefix=CHECK-FIXED-X16 < %t %s95// CHECK-FIXED-X16: "-target-feature" "+reserve-x16"96 97// RUN: %clang --target=riscv32 -ffixed-x17 -### %s 2> %t98// RUN: FileCheck --check-prefix=CHECK-FIXED-X17 < %t %s99// RUN: %clang --target=riscv64 -ffixed-x17 -### %s 2> %t100// RUN: FileCheck --check-prefix=CHECK-FIXED-X17 < %t %s101// CHECK-FIXED-X17: "-target-feature" "+reserve-x17"102 103// RUN: %clang --target=riscv32 -ffixed-x18 -### %s 2> %t104// RUN: FileCheck --check-prefix=CHECK-FIXED-X18 < %t %s105// RUN: %clang --target=riscv64 -ffixed-x18 -### %s 2> %t106// RUN: FileCheck --check-prefix=CHECK-FIXED-X18 < %t %s107// CHECK-FIXED-X18: "-target-feature" "+reserve-x18"108 109// RUN: %clang --target=riscv32 -ffixed-x19 -### %s 2> %t110// RUN: FileCheck --check-prefix=CHECK-FIXED-X19 < %t %s111// RUN: %clang --target=riscv64 -ffixed-x19 -### %s 2> %t112// RUN: FileCheck --check-prefix=CHECK-FIXED-X19 < %t %s113// CHECK-FIXED-X19: "-target-feature" "+reserve-x19"114 115// RUN: %clang --target=riscv32 -ffixed-x20 -### %s 2> %t116// RUN: FileCheck --check-prefix=CHECK-FIXED-X20 < %t %s117// RUN: %clang --target=riscv64 -ffixed-x20 -### %s 2> %t118// RUN: FileCheck --check-prefix=CHECK-FIXED-X20 < %t %s119// CHECK-FIXED-X20: "-target-feature" "+reserve-x20"120 121// RUN: %clang --target=riscv32 -ffixed-x21 -### %s 2> %t122// RUN: FileCheck --check-prefix=CHECK-FIXED-X21 < %t %s123// RUN: %clang --target=riscv64 -ffixed-x21 -### %s 2> %t124// RUN: FileCheck --check-prefix=CHECK-FIXED-X21 < %t %s125// CHECK-FIXED-X21: "-target-feature" "+reserve-x21"126 127// RUN: %clang --target=riscv32 -ffixed-x22 -### %s 2> %t128// RUN: FileCheck --check-prefix=CHECK-FIXED-X22 < %t %s129// RUN: %clang --target=riscv64 -ffixed-x22 -### %s 2> %t130// RUN: FileCheck --check-prefix=CHECK-FIXED-X22 < %t %s131// CHECK-FIXED-X22: "-target-feature" "+reserve-x22"132 133// RUN: %clang --target=riscv32 -ffixed-x23 -### %s 2> %t134// RUN: FileCheck --check-prefix=CHECK-FIXED-X23 < %t %s135// RUN: %clang --target=riscv64 -ffixed-x23 -### %s 2> %t136// RUN: FileCheck --check-prefix=CHECK-FIXED-X23 < %t %s137// CHECK-FIXED-X23: "-target-feature" "+reserve-x23"138 139// RUN: %clang --target=riscv32 -ffixed-x24 -### %s 2> %t140// RUN: FileCheck --check-prefix=CHECK-FIXED-X24 < %t %s141// RUN: %clang --target=riscv64 -ffixed-x24 -### %s 2> %t142// RUN: FileCheck --check-prefix=CHECK-FIXED-X24 < %t %s143// CHECK-FIXED-X24: "-target-feature" "+reserve-x24"144 145// RUN: %clang --target=riscv32 -ffixed-x25 -### %s 2> %t146// RUN: FileCheck --check-prefix=CHECK-FIXED-X25 < %t %s147// RUN: %clang --target=riscv64 -ffixed-x25 -### %s 2> %t148// RUN: FileCheck --check-prefix=CHECK-FIXED-X25 < %t %s149// CHECK-FIXED-X25: "-target-feature" "+reserve-x25"150 151// RUN: %clang --target=riscv32 -ffixed-x26 -### %s 2> %t152// RUN: FileCheck --check-prefix=CHECK-FIXED-X26 < %t %s153// RUN: %clang --target=riscv64 -ffixed-x26 -### %s 2> %t154// RUN: FileCheck --check-prefix=CHECK-FIXED-X26 < %t %s155// CHECK-FIXED-X26: "-target-feature" "+reserve-x26"156 157// RUN: %clang --target=riscv32 -ffixed-x27 -### %s 2> %t158// RUN: FileCheck --check-prefix=CHECK-FIXED-X27 < %t %s159// RUN: %clang --target=riscv64 -ffixed-x27 -### %s 2> %t160// RUN: FileCheck --check-prefix=CHECK-FIXED-X27 < %t %s161// CHECK-FIXED-X27: "-target-feature" "+reserve-x27"162 163// RUN: %clang --target=riscv32 -ffixed-x28 -### %s 2> %t164// RUN: FileCheck --check-prefix=CHECK-FIXED-X28 < %t %s165// RUN: %clang --target=riscv64 -ffixed-x28 -### %s 2> %t166// RUN: FileCheck --check-prefix=CHECK-FIXED-X28 < %t %s167// CHECK-FIXED-X28: "-target-feature" "+reserve-x28"168 169// RUN: %clang --target=riscv32 -ffixed-x29 -### %s 2> %t170// RUN: FileCheck --check-prefix=CHECK-FIXED-X29 < %t %s171// RUN: %clang --target=riscv64 -ffixed-x29 -### %s 2> %t172// RUN: FileCheck --check-prefix=CHECK-FIXED-X29 < %t %s173// CHECK-FIXED-X29: "-target-feature" "+reserve-x29"174 175// RUN: %clang --target=riscv32 -ffixed-x30 -### %s 2> %t176// RUN: FileCheck --check-prefix=CHECK-FIXED-X30 < %t %s177// RUN: %clang --target=riscv64 -ffixed-x30 -### %s 2> %t178// RUN: FileCheck --check-prefix=CHECK-FIXED-X30 < %t %s179// CHECK-FIXED-X30: "-target-feature" "+reserve-x30"180 181// RUN: %clang --target=riscv32 -ffixed-x31 -### %s 2> %t182// RUN: FileCheck --check-prefix=CHECK-FIXED-X31 < %t %s183// RUN: %clang --target=riscv64 -ffixed-x31 -### %s 2> %t184// RUN: FileCheck --check-prefix=CHECK-FIXED-X31 < %t %s185// CHECK-FIXED-X31: "-target-feature" "+reserve-x31"186 187// Test multiple of reserve-x# options together.188// RUN: %clang --target=riscv32 \189// RUN: -ffixed-x1 \190// RUN: -ffixed-x2 \191// RUN: -ffixed-x18 \192// RUN: -### %s 2> %t193// RUN: FileCheck \194// RUN: --check-prefix=CHECK-FIXED-X1 \195// RUN: --check-prefix=CHECK-FIXED-X2 \196// RUN: --check-prefix=CHECK-FIXED-X18 \197// RUN: < %t %s198// RUN: %clang --target=riscv64 \199// RUN: -ffixed-x1 \200// RUN: -ffixed-x2 \201// RUN: -ffixed-x18 \202// RUN: -### %s 2> %t203// RUN: FileCheck \204// RUN: --check-prefix=CHECK-FIXED-X1 \205// RUN: --check-prefix=CHECK-FIXED-X2 \206// RUN: --check-prefix=CHECK-FIXED-X18 \207// RUN: < %t %s208 209// Test all reserve-x# options together.210// RUN: %clang --target=riscv32 \211// RUN: -ffixed-x1 \212// RUN: -ffixed-x2 \213// RUN: -ffixed-x3 \214// RUN: -ffixed-x4 \215// RUN: -ffixed-x5 \216// RUN: -ffixed-x6 \217// RUN: -ffixed-x7 \218// RUN: -ffixed-x8 \219// RUN: -ffixed-x9 \220// RUN: -ffixed-x10 \221// RUN: -ffixed-x11 \222// RUN: -ffixed-x12 \223// RUN: -ffixed-x13 \224// RUN: -ffixed-x14 \225// RUN: -ffixed-x15 \226// RUN: -ffixed-x16 \227// RUN: -ffixed-x17 \228// RUN: -ffixed-x18 \229// RUN: -ffixed-x19 \230// RUN: -ffixed-x20 \231// RUN: -ffixed-x21 \232// RUN: -ffixed-x22 \233// RUN: -ffixed-x23 \234// RUN: -ffixed-x24 \235// RUN: -ffixed-x25 \236// RUN: -ffixed-x26 \237// RUN: -ffixed-x27 \238// RUN: -ffixed-x28 \239// RUN: -ffixed-x29 \240// RUN: -ffixed-x30 \241// RUN: -ffixed-x31 \242// RUN: -### %s 2> %t243// RUN: FileCheck \244// RUN: --check-prefix=CHECK-FIXED-X1 \245// RUN: --check-prefix=CHECK-FIXED-X2 \246// RUN: --check-prefix=CHECK-FIXED-X3 \247// RUN: --check-prefix=CHECK-FIXED-X4 \248// RUN: --check-prefix=CHECK-FIXED-X5 \249// RUN: --check-prefix=CHECK-FIXED-X6 \250// RUN: --check-prefix=CHECK-FIXED-X7 \251// RUN: --check-prefix=CHECK-FIXED-X8 \252// RUN: --check-prefix=CHECK-FIXED-X9 \253// RUN: --check-prefix=CHECK-FIXED-X10 \254// RUN: --check-prefix=CHECK-FIXED-X11 \255// RUN: --check-prefix=CHECK-FIXED-X12 \256// RUN: --check-prefix=CHECK-FIXED-X13 \257// RUN: --check-prefix=CHECK-FIXED-X14 \258// RUN: --check-prefix=CHECK-FIXED-X15 \259// RUN: --check-prefix=CHECK-FIXED-X16 \260// RUN: --check-prefix=CHECK-FIXED-X17 \261// RUN: --check-prefix=CHECK-FIXED-X18 \262// RUN: --check-prefix=CHECK-FIXED-X19 \263// RUN: --check-prefix=CHECK-FIXED-X20 \264// RUN: --check-prefix=CHECK-FIXED-X21 \265// RUN: --check-prefix=CHECK-FIXED-X22 \266// RUN: --check-prefix=CHECK-FIXED-X23 \267// RUN: --check-prefix=CHECK-FIXED-X24 \268// RUN: --check-prefix=CHECK-FIXED-X25 \269// RUN: --check-prefix=CHECK-FIXED-X26 \270// RUN: --check-prefix=CHECK-FIXED-X27 \271// RUN: --check-prefix=CHECK-FIXED-X28 \272// RUN: --check-prefix=CHECK-FIXED-X29 \273// RUN: --check-prefix=CHECK-FIXED-X30 \274// RUN: --check-prefix=CHECK-FIXED-X31 \275// RUN: < %t %s276// RUN: %clang --target=riscv64 \277// RUN: -ffixed-x1 \278// RUN: -ffixed-x2 \279// RUN: -ffixed-x3 \280// RUN: -ffixed-x4 \281// RUN: -ffixed-x5 \282// RUN: -ffixed-x6 \283// RUN: -ffixed-x7 \284// RUN: -ffixed-x8 \285// RUN: -ffixed-x9 \286// RUN: -ffixed-x10 \287// RUN: -ffixed-x11 \288// RUN: -ffixed-x12 \289// RUN: -ffixed-x13 \290// RUN: -ffixed-x14 \291// RUN: -ffixed-x15 \292// RUN: -ffixed-x16 \293// RUN: -ffixed-x17 \294// RUN: -ffixed-x18 \295// RUN: -ffixed-x19 \296// RUN: -ffixed-x20 \297// RUN: -ffixed-x21 \298// RUN: -ffixed-x22 \299// RUN: -ffixed-x23 \300// RUN: -ffixed-x24 \301// RUN: -ffixed-x25 \302// RUN: -ffixed-x26 \303// RUN: -ffixed-x27 \304// RUN: -ffixed-x28 \305// RUN: -ffixed-x29 \306// RUN: -ffixed-x30 \307// RUN: -ffixed-x31 \308// RUN: -### %s 2> %t309// RUN: FileCheck \310// RUN: --check-prefix=CHECK-FIXED-X1 \311// RUN: --check-prefix=CHECK-FIXED-X2 \312// RUN: --check-prefix=CHECK-FIXED-X3 \313// RUN: --check-prefix=CHECK-FIXED-X4 \314// RUN: --check-prefix=CHECK-FIXED-X5 \315// RUN: --check-prefix=CHECK-FIXED-X6 \316// RUN: --check-prefix=CHECK-FIXED-X7 \317// RUN: --check-prefix=CHECK-FIXED-X8 \318// RUN: --check-prefix=CHECK-FIXED-X9 \319// RUN: --check-prefix=CHECK-FIXED-X10 \320// RUN: --check-prefix=CHECK-FIXED-X11 \321// RUN: --check-prefix=CHECK-FIXED-X12 \322// RUN: --check-prefix=CHECK-FIXED-X13 \323// RUN: --check-prefix=CHECK-FIXED-X14 \324// RUN: --check-prefix=CHECK-FIXED-X15 \325// RUN: --check-prefix=CHECK-FIXED-X16 \326// RUN: --check-prefix=CHECK-FIXED-X17 \327// RUN: --check-prefix=CHECK-FIXED-X18 \328// RUN: --check-prefix=CHECK-FIXED-X19 \329// RUN: --check-prefix=CHECK-FIXED-X20 \330// RUN: --check-prefix=CHECK-FIXED-X21 \331// RUN: --check-prefix=CHECK-FIXED-X22 \332// RUN: --check-prefix=CHECK-FIXED-X23 \333// RUN: --check-prefix=CHECK-FIXED-X24 \334// RUN: --check-prefix=CHECK-FIXED-X25 \335// RUN: --check-prefix=CHECK-FIXED-X26 \336// RUN: --check-prefix=CHECK-FIXED-X27 \337// RUN: --check-prefix=CHECK-FIXED-X28 \338// RUN: --check-prefix=CHECK-FIXED-X29 \339// RUN: --check-prefix=CHECK-FIXED-X30 \340// RUN: --check-prefix=CHECK-FIXED-X31 \341// RUN: < %t %s342