aboutsummaryrefslogtreecommitdiff
path: root/clang/test/AST/ByteCode/invalid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/AST/ByteCode/invalid.cpp')
-rw-r--r--clang/test/AST/ByteCode/invalid.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/AST/ByteCode/invalid.cpp b/clang/test/AST/ByteCode/invalid.cpp
index 1f2d6bc..115c866 100644
--- a/clang/test/AST/ByteCode/invalid.cpp
+++ b/clang/test/AST/ByteCode/invalid.cpp
@@ -88,4 +88,22 @@ namespace InvalidBitCast {
// both-note {{in call to}}
+ struct sockaddr
+ {
+ char sa_data[8];
+ };
+ struct in_addr
+ {
+ unsigned int s_addr;
+ };
+ struct sockaddr_in
+ {
+ unsigned short int sin_port;
+ struct in_addr sin_addr;
+ };
+ /// Bitcast from sockaddr to sockaddr_in. Used to crash.
+ unsigned int get_addr(sockaddr addr) {
+ return ((sockaddr_in *)&addr)->sin_addr.s_addr;
+ }
+
}