summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/asan/TestCases/Windows/bitfield.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/test/asan/TestCases/Windows/bitfield.cc')
-rw-r--r--compiler-rt/test/asan/TestCases/Windows/bitfield.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/compiler-rt/test/asan/TestCases/Windows/bitfield.cc b/compiler-rt/test/asan/TestCases/Windows/bitfield.cc
new file mode 100644
index 00000000000..e1a3fc854c9
--- /dev/null
+++ b/compiler-rt/test/asan/TestCases/Windows/bitfield.cc
@@ -0,0 +1,21 @@
+// RUN: %clangxx_asan -O0 %s -Fe%t
+// RUN: %run %t
+
+#include <windows.h>
+
+typedef struct _S {
+ unsigned int bf1:1;
+ unsigned int bf2:2;
+ unsigned int bf3:3;
+ unsigned int bf4:4;
+} S;
+
+int main(void) {
+ S *s = (S*)malloc(sizeof(S));
+ s->bf1 = 1;
+ s->bf2 = 2;
+ s->bf3 = 3;
+ s->bf4 = 4;
+ free(s);
+ return 0;
+}
OpenPOWER on IntegriCloud