aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/no_stack_protector.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/no_stack_protector.c')
-rw-r--r--test/Sema/no_stack_protector.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/Sema/no_stack_protector.c b/test/Sema/no_stack_protector.c
new file mode 100644
index 000000000000..8e52f0982f52
--- /dev/null
+++ b/test/Sema/no_stack_protector.c
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+void __attribute__((no_stack_protector)) foo() {}
+int __attribute__((no_stack_protector)) var; // expected-warning {{'no_stack_protector' attribute only applies to functions}}
+void __attribute__((no_stack_protector(2))) bar() {} // expected-error {{'no_stack_protector' attribute takes no arguments}}