[all-commits] [llvm/llvm-project] 8b3426: [RISCV] Pre-commit testcase for PR55442

Kito Cheng via All-commits all-commits at lists.llvm.org
Thu Jun 9 08:35:52 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8b3426569e1fe3105ad57b635689b4b94936b111
      https://github.com/llvm/llvm-project/commit/8b3426569e1fe3105ad57b635689b4b94936b111
  Author: Kito Cheng <kito.cheng at sifive.com>
  Date:   2022-06-09 (Thu, 09 Jun 2022)

  Changed paths:
    A llvm/test/CodeGen/RISCV/miss-sp-restore-eh.ll

  Log Message:
  -----------
  [RISCV] Pre-commit testcase for PR55442

The testcase show the stack pointer isn't recovered when we got
exception from `_Z3fooiiiiiiiiiiPi`, and then we screw up due to
restore return address from wrong stack pointer.

NOTE:
Trigger conditions:
1. Frame pointer is required.
2. Stack has out-going argument
3. Vector extension is enabled.

Another run-able testcase:

$ clang++ -target riscv64-unknown-linux-gnu -march=rv64gcv test.cpp
```
void __attribute__((noinline)) foo(int, int, int, int, int, int, int, int, int, int, int *){
 throw int(0);
}

int main(int argc, char **argv) {
  int exception_value = 1;
  try {
      foo(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  } catch (int i) {
    exception_value = i;
  }
  return exception_value;
}
```

Reviewed By: rogfer01

Differential Revision: https://reviews.llvm.org/D126860




More information about the All-commits mailing list