Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: tests_lit/llvm2ice_tests/undef.ll

Issue 339783002: Add support for undef values in ICE IR. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Comment about uninitialized registers Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/llvm2ice.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests_lit/llvm2ice_tests/undef.ll
diff --git a/tests_lit/llvm2ice_tests/undef.ll b/tests_lit/llvm2ice_tests/undef.ll
new file mode 100644
index 0000000000000000000000000000000000000000..2df08ea3aa123cd66c51cefbb51753b7d8e6f906
--- /dev/null
+++ b/tests_lit/llvm2ice_tests/undef.ll
@@ -0,0 +1,37 @@
+; This test checks that undef values are represented as zero.
+
+; RUN: %llvm2ice --verbose none %s | FileCheck %s
+; RUN: %llvm2ice -O2 --verbose none %s | FileCheck %s
+; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s
+; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s
+; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \
+; RUN: | FileCheck --check-prefix=DUMP %s
+
+define i32 @undefi32() {
+entry:
+; CHECK-LABEL: undefi32:
+ ret i32 undef
+; CHECK: mov eax, 0
+; CHECK: ret
+}
+
+define i64 @undefi64() {
+entry:
+; CHECK-LABEL: undefi64:
+ ret i64 undef
+; CHECK-DAG: mov eax, 0
+; CHECK-DAG: mov edx, 0
+; CHECK: ret
+}
+
+define float @undeffloat() {
+entry:
+; CHECK-LABEL: undeffloat:
+ ret float undef
+; CHECK-NOT: sub esp
+; CHECK: fld
+; CHECK: ret
+}
+
+; ERRORS-NOT: ICE translation error
+; DUMP-NOT: SZ
« no previous file with comments | « src/llvm2ice.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698