summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/address-safety-attr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/address-safety-attr.cpp')
-rw-r--r--test/CodeGen/address-safety-attr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/CodeGen/address-safety-attr.cpp b/test/CodeGen/address-safety-attr.cpp
index 9d0fb95..da68b1d 100644
--- a/test/CodeGen/address-safety-attr.cpp
+++ b/test/CodeGen/address-safety-attr.cpp
@@ -33,3 +33,9 @@ int TemplateAddressSafetyOk() { return i; }
int force_instance = TemplateAddressSafetyOk<42>()
+ TemplateNoAddressSafety<42>();
+
+// Check that __cxx_global_var_init* get the address_safety attribute.
+int global1 = 0;
+int global2 = *(int*)((char*)&global1+1);
+// CHECK-NOT: @__cxx_global_var_init{{.*}}address_safety
+// ASAN: @__cxx_global_var_init{{.*}}address_safety
OpenPOWER on IntegriCloud