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

Unified Diff: tests_lit/llvm2ice_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 | « src/llvm2ice.cpp ('k') | tests_lit/reader_tests/unnamed.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests_lit/llvm2ice_tests/unnamed.ll
diff --git a/tests_lit/llvm2ice_tests/unnamed.ll b/tests_lit/llvm2ice_tests/unnamed.ll
new file mode 100644
index 0000000000000000000000000000000000000000..8b623ab6850fd491ee91037972d7e8eb74cfda98
--- /dev/null
+++ b/tests_lit/llvm2ice_tests/unnamed.ll
@@ -0,0 +1,50 @@
+; Tests that we name unnamed global addresses.
+
+; RUN: %llvm2ice -notranslate -verbose=inst < %s | FileCheck %s
+
+; RUN: %llvm2ice -notranslate -verbose=inst -default-function-prefix=h \
+; RUN: -default-global-prefix=g < %s | FileCheck --check-prefix=BAD %s
+
+@0 = internal global [4 x i8] zeroinitializer, align 4
+
+; CHECK: @Global = internal global [4 x i8] zeroinitializer, align 4
+
+@1 = internal constant [10 x i8] c"Some stuff", align 1
+
+; CHECK-NEXT: @Global1 = 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'.
+
+; CHECK-NEXT: @g = internal global [4 x i8] zeroinitializer, align 4
+
+define i32 @2(i32 %v) {
+ ret i32 %v
+}
+
+; CHECK-NEXT: define i32 @Function(i32 %v) {
+; CHECK-NEXT: __0:
+; CHECK-NEXT: ret i32 %v
+; 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 | « src/llvm2ice.cpp ('k') | tests_lit/reader_tests/unnamed.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698