From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/Sema/attr-section.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 clang/test/Sema/attr-section.c (limited to 'clang/test/Sema/attr-section.c') diff --git a/clang/test/Sema/attr-section.c b/clang/test/Sema/attr-section.c new file mode 100644 index 0000000..a932525 --- /dev/null +++ b/clang/test/Sema/attr-section.c @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -verify -fsyntax-only -triple x86_64-apple-darwin9 %s + +int x __attribute__((section( + 42))); // expected-error {{argument to section attribute was not a string literal}} + + +// rdar://4341926 +int y __attribute__((section( + "sadf"))); // expected-error {{mach-o section specifier requires a segment and section separated by a comma}} + +// PR6007 +void test() { + __attribute__((section("NEAR,x"))) int n1; // expected-error {{'section' attribute is not valid on local variables}} + __attribute__((section("NEAR,x"))) static int n2; // ok. +} -- cgit v1.2.3