summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Sema/attr-naked.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/test/Sema/attr-naked.c b/clang/test/Sema/attr-naked.c
index 55c6b326ef1..c1ad52c4548 100644
--- a/clang/test/Sema/attr-naked.c
+++ b/clang/test/Sema/attr-naked.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -verify -fsyntax-only
+// RUN: %clang_cc1 %s -verify -fsyntax-only -triple i686-pc-linux
int a __attribute__((naked)); // expected-warning {{'naked' attribute only applies to functions}}
@@ -10,3 +10,11 @@ void t1() __attribute__((naked));
void t2() __attribute__((naked(2))); // expected-error {{'naked' attribute takes no arguments}}
+__attribute__((naked)) int t3() { // expected-note{{attribute is here}}
+ return 42; // expected-error{{non-ASM statement in naked function is not supported}}
+}
+
+__attribute__((naked)) int t4() {
+ asm("movl $42, %eax");
+ asm("retl");
+}
OpenPOWER on IntegriCloud