From: Daniel Dunbar Date: Mon, 11 Oct 2010 21:13:48 +0000 (+0000) Subject: IRgen/Obj-C: Fix encoding of "long double". X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a0be84b2aed8563150cdbd976a98838afa261eb;p=clang IRgen/Obj-C: Fix encoding of "long double". - The mind boggles. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116226 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 72d7f600f0..e25429bfb9 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -3701,7 +3701,7 @@ static char ObjCEncodingForPrimitiveKind(const ASTContext *C, QualType T) { case BuiltinType::Int128: return 't'; case BuiltinType::Float: return 'f'; case BuiltinType::Double: return 'd'; - case BuiltinType::LongDouble: return 'd'; + case BuiltinType::LongDouble: return 'D'; } } diff --git a/test/CodeGenObjC/encode-test.m b/test/CodeGenObjC/encode-test.m index 2f0c335cfa..24a90a0b4b 100644 --- a/test/CodeGenObjC/encode-test.m +++ b/test/CodeGenObjC/encode-test.m @@ -138,3 +138,9 @@ const char g6[] = @encode(Base1X); // CHECK: @g7 = constant [27 x i8] c"{Derived1X=b2b3b4b5b5b4b3}\00" const char g7[] = @encode(Derived1X); + +// CHECK: @g8 = constant [7 x i8] c"{s8=D}\00" +struct s8 { + long double x; +}; +const char g8[] = @encode(struct s8);