summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/small_alignment.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gnat.dg/small_alignment.adb')
-rw-r--r--gcc/testsuite/gnat.dg/small_alignment.adb28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/small_alignment.adb b/gcc/testsuite/gnat.dg/small_alignment.adb
new file mode 100644
index 000000000..fbe1c2145
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/small_alignment.adb
@@ -0,0 +1,28 @@
+-- { dg-do run }
+-- { dg-options "-gnatws" }
+
+procedure Small_Alignment is
+
+ type My_Integer is new Integer;
+ for My_Integer'Alignment use 1;
+
+ function Set_A return My_Integer is
+ begin
+ return 12;
+ end;
+
+ function Set_B return My_Integer is
+ begin
+ return 6;
+ end;
+
+ C : Character;
+ A : My_Integer := Set_A;
+ B : My_Integer := Set_B;
+
+begin
+ A := A * B / 2;
+ if A /= 36 then
+ raise Program_Error;
+ end if;
+end;