[Lldb-commits] [lldb] e8beb69 - [lldb] [test/Register] Attempt to fix x86-fp-read.test on Darwin
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Sun Oct 4 23:05:13 PDT 2020
Author: Michał Górny
Date: 2020-10-04T23:04:40-07:00
New Revision: e8beb6988bab71ee4917288f07674b4982736109
URL: https://github.com/llvm/llvm-project/commit/e8beb6988bab71ee4917288f07674b4982736109
DIFF: https://github.com/llvm/llvm-project/commit/e8beb6988bab71ee4917288f07674b4982736109.diff
LOG: [lldb] [test/Register] Attempt to fix x86-fp-read.test on Darwin
Darwin seems to use stmmN instead of stN. Use a regex to accept both.
Also try to actually clear st(7).
Differential revision: https://reviews.llvm.org/D88795
Added:
Modified:
lldb/test/Shell/Register/Inputs/x86-fp-read.cpp
lldb/test/Shell/Register/x86-fp-read.test
Removed:
################################################################################
diff --git a/lldb/test/Shell/Register/Inputs/x86-fp-read.cpp b/lldb/test/Shell/Register/Inputs/x86-fp-read.cpp
index 1bd2d60affa2..63971e20b62f 100644
--- a/lldb/test/Shell/Register/Inputs/x86-fp-read.cpp
+++ b/lldb/test/Shell/Register/Inputs/x86-fp-read.cpp
@@ -14,7 +14,8 @@ int main() {
{0x8000000000000000, 0x7fff}, // +inf
{0x8000000000000000, 0xffff}, // -inf
{0xc000000000000000, 0xffff}, // nan
- // leave st7 empty to test tag word better
+ // st7 will be freed to test tag word better
+ {0x0000000000000000, 0x0000}, // +0
};
// unmask divide-by-zero exception
@@ -26,6 +27,7 @@ int main() {
"finit\n\t"
"fldcw %1\n\t"
// load on stack in reverse order to make the result easier to read
+ "fldt 0x70(%0)\n\t"
"fldt 0x60(%0)\n\t"
"fldt 0x50(%0)\n\t"
"fldt 0x40(%0)\n\t"
@@ -33,6 +35,8 @@ int main() {
"fldt 0x20(%0)\n\t"
"fldt 0x10(%0)\n\t"
"fldt 0x00(%0)\n\t"
+ // free st7
+ "ffree %%st(7)\n\t"
// this should trigger a divide-by-zero
"fdivs (%2)\n\t"
"int3\n\t"
diff --git a/lldb/test/Shell/Register/x86-fp-read.test b/lldb/test/Shell/Register/x86-fp-read.test
index eac942f5989c..f0c35c726c7c 100644
--- a/lldb/test/Shell/Register/x86-fp-read.test
+++ b/lldb/test/Shell/Register/x86-fp-read.test
@@ -1,5 +1,4 @@
# XFAIL: system-windows
-# XFAIL: system-darwin
# REQUIRES: native && (target-x86 || target-x86_64)
# RUN: %clangxx_host -g %p/Inputs/x86-fp-read.cpp -o %t
# RUN: %lldb -b -s %s %t | FileCheck %s
@@ -8,20 +7,20 @@ process launch
register read --all
# CHECK-DAG: fctrl = 0x037b
-# CHECK-DAG: fstat = 0x8884
+# CHECK-DAG: fstat = 0x8084
# TODO: the following value is incorrect, it's a bug in the way
-# FXSAVE/XSAVE is interpreted; it should be 0xa963 once fixed
-# CHECK-DAG: ftag = 0x00fe
+# FXSAVE/XSAVE is interpreted
+# CHECK-DAG: ftag = 0x007f
# CHECK-DAG: fop = 0x0033
-# CHECK-DAG: st0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x00 0x40}
-# CHECK-DAG: st1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x3f 0x00 0x00}
-# CHECK-DAG: st2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
-# CHECK-DAG: st3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80}
-# CHECK-DAG: st4 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0xff 0x7f}
-# CHECK-DAG: st5 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0xff 0xff}
-# CHECK-DAG: st6 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xc0 0xff 0xff}
-# CHECK-DAG: st7 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: st{{(mm)?}}0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x00 0x40}
+# CHECK-DAG: st{{(mm)?}}1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x3f 0x00 0x00}
+# CHECK-DAG: st{{(mm)?}}2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
+# CHECK-DAG: st{{(mm)?}}3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80}
+# CHECK-DAG: st{{(mm)?}}4 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0xff 0x7f}
+# CHECK-DAG: st{{(mm)?}}5 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0xff 0xff}
+# CHECK-DAG: st{{(mm)?}}6 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xc0 0xff 0xff}
+# CHECK-DAG: st{{(mm)?}}7 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
# fdiv (%rbx) gets encoded into 2 bytes, int3 into 1 byte
print (void*)($pc-3)
More information about the lldb-commits
mailing list