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

Unified Diff: tests_lit/reader_tests/unnamed.ll

Issue 567703003: Allow ability to name unnamed global addresses in Subzero. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add tests Created 6 years, 3 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
« src/llvm2ice.cpp ('K') | « tests_lit/llvm2ice_tests/unnamed.ll ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests_lit/reader_tests/unnamed.ll
diff --git a/tests_lit/reader_tests/unnamed.ll b/tests_lit/reader_tests/unnamed.ll
new file mode 100644
index 0000000000000000000000000000000000000000..883445101a2916c009a85396ef0ea99eaa1cccba
--- /dev/null
+++ b/tests_lit/reader_tests/unnamed.ll
@@ -0,0 +1,45 @@
+; Tests that we name unnamed global addresses.
+
+; RUN: llvm-as < %s | pnacl-freeze \
+; RUN: | %llvm2ice -notranslate -verbose=inst -build-on-read \
+; RUN: -default-global-prefix=__g -allow-pnacl-reader-error-recovery \
Jim Stichnoth 2014/09/11 22:08:19 80-char, here and line 10
+; RUN: | FileCheck %s
+
+; RUN: llvm-as < %s | pnacl-freeze \
+; RUN: | %llvm2ice -notranslate -verbose=inst -build-on-read \
+; RUN: -default-global-prefix=h -allow-pnacl-reader-error-recovery \
+; RUN: 2>& 1 | FileCheck --check-prefix=BAD %s
Jim Stichnoth 2014/09/11 22:08:19 Currently the warning message is going to llvm::ou
Karl 2014/09/12 16:29:06 Not anymore. Fixing.
+
+; TODO(kschimpf) Check global variable declarations, once generated.
+
+@0 = internal global [4 x i8] zeroinitializer, align 4
+@1 = internal constant [10 x i8] c"Some stuff", align 1
+
+define i32 @2(i32 %v) {
+ ret i32 %v
+}
+
+; CHECK: define i32 @__g2(i32 %__0) {
+; CHECK-NEXT: __0:
+; CHECK-NEXT: ret i32 %__0
+; CHECK-NEXT: }
+
+define void @hg() {
+ ret void
+}
+
+; BAD: Warning: Default global prefix 'h' conflicts with name 'hg'.
+
+; CHECK-NEXT: define void @hg() {
+; CHECK-NEXT: __0:
+; CHECK-NEXT: ret void
+; CHECK-NEXT: }
+
+define void @3() {
+ ret void
+}
+
+; CHECK-NEXT: define void @__g3() {
+; CHECK-NEXT: __0:
+; CHECK-NEXT: ret void
+; CHECK-NEXT: }
« src/llvm2ice.cpp ('K') | « tests_lit/llvm2ice_tests/unnamed.ll ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698