[PATCH] D22112: Disambiguate a constant with both 0B prefix and H suffix.

Yunzhong Gao via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 26 19:54:48 PDT 2016


ygao marked an inline comment as done.

================
Comment at: tools/clang/test/CodeGenCXX/ms-inline-asm-return.cpp:88
@@ -87,3 +87,3 @@
 // CHECK-LABEL: define i64 @f_s8()
-// CHECK: %[[r:[^ ]*]] = call i64 asm sideeffect inteldialect "mov eax, $$0x01010101\0A\09mov edx, $$0x01010101", "=A,~{eax},{{.*}}"
+// CHECK: %[[r:[^ ]*]] = call i64 asm sideeffect inteldialect "mov eax, $$01010101h\0A\09mov edx, $$01010101h", "=A,~{eax},{{.*}}"
 // CHECK: store i64 %[[r]], i64* %{{.*}}
----------------
AOK_ImmPrefix is used in this case for a decimal integer without ignorable suffix (U or L), but in that case rewriting does not make a noticeable difference. I modified this test slightly to make sure we still strip out the ignorable suffix.
While I do not think rewriting a hex number into decimal should really be considered wrong, it is fairly straightforward to get the hex output back by modifying LexDigit() to consider the [hHbB] suffix as part of the number (in the same spirit that the 0[xb] prefix is considered part of the number with the AT&T syntax).


https://reviews.llvm.org/D22112





More information about the llvm-commits mailing list