diff options
| author | Hans Wennborg <hans@hanshq.net> | 2014-06-17 00:00:18 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2014-06-17 00:00:18 +0000 |
| commit | fe781458d81de407fe8ca9999b06d34231e70210 (patch) | |
| tree | 518ab02df2a427f45745512318dff0b0f61de589 /clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp | |
| parent | 2da1bbc113f654b5dd63e1cf47784a6c6c19024b (diff) | |
| download | bcm5719-llvm-fe781458d81de407fe8ca9999b06d34231e70210.tar.gz bcm5719-llvm-fe781458d81de407fe8ca9999b06d34231e70210.zip | |
MS static locals mangling: don't count enum scopes
We may not have the mangling for static locals vs. enums completely figured out,
but at least for my simple test cases, enums should not increment the mangling
number.
Differential Revision: http://reviews.llvm.org/D4164
llvm-svn: 211078
Diffstat (limited to 'clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp')
| -rw-r--r-- | clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp b/clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp index 5666553f3a2..e96a5edd654 100644 --- a/clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp +++ b/clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp @@ -143,10 +143,31 @@ inline S &getS() { // init.end: // CHECK: ret %struct.S* @"\01?TheS@?1??getS@@YAAAUS@@XZ@4U2@A" +inline int enum_in_function() { + // CHECK-LABEL: define linkonce_odr i32 @"\01?enum_in_function@@YAHXZ"() + static enum e { foo, bar, baz } x; + // CHECK: @"\01?x@?1??enum_in_function@@YAHXZ@4W4e@?1??1@YAHXZ@A" + static int y; + // CHECK: @"\01?y@?1??enum_in_function@@YAHXZ@4HA" + return x + y; +}; + +struct T { + enum e { foo, bar, baz }; + int enum_in_struct() { + // CHECK-LABEL: define linkonce_odr x86_thiscallcc i32 @"\01?enum_in_struct@T@@QAEHXZ" + static int x; + // CHECK: @"\01?x@?1??enum_in_struct@T@@QAEHXZ@4HA" + return x++; + } +}; + void force_usage() { UnreachableStatic(); getS(); (void)B<int>::foo; // (void) - force usage + enum_in_function(); + (void)&T::enum_in_struct; } // CHECK: define linkonce_odr void @"\01??__Efoo@?$B@H@@2VA@@A@YAXXZ"() |

