aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-02-24 22:40:36 +0000
committerDouglas Gregor <dgregor@apple.com>2012-02-24 22:40:36 +0000
commita98a28534e48e59d5f7d69adae121589e298dd43 (patch)
tree50205e7384e8a5238d940a7a21ad6751ae7f235c /test
parentc7b5543ad32a5c265c02e71b2a6f9856440ed13f (diff)
For the purposes of building LLVM types, a forward-declared
enumeration type with a fixed underlying type is complete. Fixes <rdar://problem/10916155>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151403 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGenCXX/forward-enum.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGenCXX/forward-enum.cpp b/test/CodeGenCXX/forward-enum.cpp
new file mode 100644
index 0000000000..c1169e0139
--- /dev/null
+++ b/test/CodeGenCXX/forward-enum.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -std=c++11 -triple x86_64-apple-darwin11.0.0 -emit-llvm -o - %s | FileCheck %s
+
+enum MyEnum : char;
+void bar(MyEnum value) { }
+
+// CHECK: define void @_Z3foo6MyEnum
+void foo(MyEnum value)
+{
+ // CHECK: call void @_Z3bar6MyEnum(i8 signext
+ bar(value);
+}