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

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: Fix nits in patch set 4. 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
« no previous file with comments | « 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..72c274cbf6c92e83e95fc8da2934750dff167612
--- /dev/null
+++ b/tests_lit/reader_tests/unnamed.ll
@@ -0,0 +1,49 @@
+; Tests that we name unnamed global addresses.
+
+; RUN: llvm-as < %s | pnacl-freeze \
+; RUN: | %llvm2ice -notranslate -verbose=inst -build-on-read \
+; RUN: -allow-pnacl-reader-error-recovery \
+; RUN: | FileCheck %s
+
+; RUN: llvm-as < %s | pnacl-freeze \
+; RUN: | %llvm2ice -notranslate -verbose=inst -build-on-read \
+; RUN: -default-function-prefix=h -default-global-prefix=g \
+; RUN: -allow-pnacl-reader-error-recovery \
+; RUN: | FileCheck --check-prefix=BAD %s
+
+; 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
+@g = internal global [4 x i8] zeroinitializer, align 4
+
+; BAD: Warning: Default global prefix 'g' conflicts with name 'g'.
+
+define i32 @2(i32 %v) {
+ ret i32 %v
+}
+
+; CHECK: define i32 @Function(i32 %__0) {
+; CHECK-NEXT: __0:
+; CHECK-NEXT: ret i32 %__0
+; CHECK-NEXT: }
+
+define void @hg() {
+ ret void
+}
+
+; BAD: Warning: Default function 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 @Function1() {
+; CHECK-NEXT: __0:
+; CHECK-NEXT: ret void
+; CHECK-NEXT: }
« no previous file with comments | « tests_lit/llvm2ice_tests/unnamed.ll ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698