summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/microsoft-uuidof.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2013-08-09 08:56:20 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2013-08-09 08:56:20 +0000
commit89085340befe24dee8c6084f24d3fa3316823073 (patch)
tree8a6c50ddf755cd13268d13b38050b68ce2899049 /clang/test/CodeGenCXX/microsoft-uuidof.cpp
parentcf963cece85290bdafed4f0d607ab8d899510711 (diff)
downloadbcm5719-llvm-89085340befe24dee8c6084f24d3fa3316823073.tar.gz
bcm5719-llvm-89085340befe24dee8c6084f24d3fa3316823073.zip
Sema: Assertion failure during CodeGen in CodeGenModule::EmitUuidofInitializer
Make sure we can properly generate code when the UUID has curly braces on it, strip the curly braces at the sema layer. This fixes PR16813. llvm-svn: 188061
Diffstat (limited to 'clang/test/CodeGenCXX/microsoft-uuidof.cpp')
-rw-r--r--clang/test/CodeGenCXX/microsoft-uuidof.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/microsoft-uuidof.cpp b/clang/test/CodeGenCXX/microsoft-uuidof.cpp
index 22e750183d5..38ffafc0074 100644
--- a/clang/test/CodeGenCXX/microsoft-uuidof.cpp
+++ b/clang/test/CodeGenCXX/microsoft-uuidof.cpp
@@ -10,6 +10,11 @@ typedef struct _GUID
struct __declspec(uuid("12345678-1234-1234-1234-1234567890aB")) S1 { } s1;
struct __declspec(uuid("87654321-4321-4321-4321-ba0987654321")) S2 { };
+struct __declspec(uuid("{12345678-1234-1234-1234-1234567890ac}")) Curly;
+
+// Make sure we can properly generate code when the UUID has curly braces on it.
+GUID thing = __uuidof(Curly);
+// CHECK: @thing = global %struct._GUID zeroinitializer, align 4
// This gets initialized in a static initializer.
// CHECK: @g = global %struct._GUID zeroinitializer, align 4
@@ -23,6 +28,9 @@ const GUID& gr = __uuidof(S1);
// CHECK: @gp = global %struct._GUID* @_GUID_12345678_1234_1234_1234_1234567890ab, align 4
const GUID* gp = &__uuidof(S1);
+// CHECK: @cp = global %struct._GUID* @_GUID_12345678_1234_1234_1234_1234567890ac, align 4
+const GUID* cp = &__uuidof(Curly);
+
// Special case: _uuidof(0)
// CHECK: @zeroiid = constant %struct._GUID* @_GUID_00000000_0000_0000_0000_000000000000, align 4
const GUID& zeroiid = __uuidof(0);
OpenPOWER on IntegriCloud