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

Unified Diff: test/Transforms/NaCl/flatten-globals.ll

Issue 15359006: PNaCl: Fix FlattenGlobals to correctly handle implicitly-aligned variables (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Created 7 years, 7 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 | « lib/Transforms/NaCl/FlattenGlobals.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/Transforms/NaCl/flatten-globals.ll
diff --git a/test/Transforms/NaCl/flatten-globals.ll b/test/Transforms/NaCl/flatten-globals.ll
index 4ac96d6a7cf6f7f69a5d8292e5c298647799f29b..938f11fec7b50aa0b41baa0eaabf1888df841040 100644
--- a/test/Transforms/NaCl/flatten-globals.ll
+++ b/test/Transforms/NaCl/flatten-globals.ll
@@ -91,6 +91,26 @@ target datalayout = "p:32:32:32"
; CHECK: @aligned_var = global [4 x i8] c"\04\01\00\00", align 8
+; Check alignment handling
+
+@implicit_alignment_i32 = global i32 zeroinitializer
+; CHECK: @implicit_alignment_i32 = global [4 x i8] zeroinitializer, align 4
+
+@implicit_alignment_double = global double zeroinitializer
+; CHECK: @implicit_alignment_double = global [8 x i8] zeroinitializer, align 8
+
+; FlattenGlobals is not allowed to increase the alignment of the
+; variable when an explicit section is specified (although PNaCl does
+; not support this attribute).
+@lower_alignment_section = global i32 0, section "mysection", align 1
+; CHECK: @lower_alignment_section = global [4 x i8] zeroinitializer, section "mysection", align 1
+
+; FlattenGlobals could increase the alignment when no section is
+; specified, but it does not.
+@lower_alignment = global i32 0, align 1
+; CHECK: @lower_alignment = global [4 x i8] zeroinitializer, align 1
+
+
; Check handling of global references
@var1 = external global i32
« no previous file with comments | « lib/Transforms/NaCl/FlattenGlobals.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698