aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-02-25 18:10:49 +0000
committerDuncan Sands <baldrick@free.fr>2009-02-25 18:10:49 +0000
commit411c28540454c536519f04a2fde461e91ad1f661 (patch)
treee6d886f84122220b8743e5c5fffc7595f8d939f9
parent9a7c743fc0d45e4f2331c4092d3f29bf18351e6f (diff)
Check that records with a known constant size are not
copied field by LLVM field if the record has a variable sized field in it. The problem is that the LLVM field will not completely cover the variable sized gcc field. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65463 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/FrontendAda/Support/element_copy.ads8
-rw-r--r--test/FrontendAda/element_copy.adb8
2 files changed, 16 insertions, 0 deletions
diff --git a/test/FrontendAda/Support/element_copy.ads b/test/FrontendAda/Support/element_copy.ads
new file mode 100644
index 0000000000..52c6e49275
--- /dev/null
+++ b/test/FrontendAda/Support/element_copy.ads
@@ -0,0 +1,8 @@
+package Element_Copy is
+ type SmallInt is range 1 .. 4;
+ type SmallStr is array (SmallInt range <>) of Character;
+ type VariableSizedField (D : SmallInt := 2) is record
+ S : SmallStr (1 .. D) := "Hi";
+ end record;
+ function F return VariableSizedField;
+end;
diff --git a/test/FrontendAda/element_copy.adb b/test/FrontendAda/element_copy.adb
new file mode 100644
index 0000000000..29274fa744
--- /dev/null
+++ b/test/FrontendAda/element_copy.adb
@@ -0,0 +1,8 @@
+-- RUN: %llvmgcc -S -O2 %s -I%p/Support -o - | grep 105 | count 2
+package body Element_Copy is
+ function F return VariableSizedField is
+ X : VariableSizedField;
+ begin
+ return X;
+ end;
+end;