diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-10-22 21:08:43 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-10-22 21:08:43 +0000 |
commit | ec0db6fac94a6093e02bec8398f45e29edd9d689 (patch) | |
tree | 171be2fa84aba69adb607384675784d17e5573b6 /test/CodeGenCXX/sections.cpp | |
parent | ca2a03fbf31be62ba5720fa699be1a905a7d4a27 (diff) |
Parse: Ignore "long" and "short" in #pragma section
This fixes PR21337.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220429 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/sections.cpp')
-rw-r--r-- | test/CodeGenCXX/sections.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGenCXX/sections.cpp b/test/CodeGenCXX/sections.cpp index ba2c1255f7..f84f9d939c 100644 --- a/test/CodeGenCXX/sections.cpp +++ b/test/CodeGenCXX/sections.cpp @@ -38,6 +38,17 @@ __declspec(allocate("read_flag_section")) int unreferenced = 0; extern __declspec(allocate("read_flag_section")) int referenced = 42; int *user() { return &referenced; } +#pragma section("no_section_attributes") +// A pragma section with no section attributes is read/write. +__declspec(allocate("no_section_attributes")) int implicitly_read_write = 42; + +#pragma section("long_section", long) +// Pragma section ignores "long". +__declspec(allocate("long_section")) long long_var = 42; + +#pragma section("short_section", short) +// Pragma section ignores "short". +__declspec(allocate("short_section")) short short_var = 42; } //CHECK: @D = global i32 1 @@ -54,5 +65,8 @@ int *user() { return &referenced; } //CHECK: @TEST2 = global i32 0, section ".bss1" //CHECK: @unreferenced = constant i32 0, section "read_flag_section" //CHECK: @referenced = constant i32 42, section "read_flag_section" +//CHECK: @implicitly_read_write = global i32 42, section "no_section_attributes" +//CHECK: @long_var = global i32 42, section "long_section" +//CHECK: @short_var = global i16 42, section "short_section" //CHECK: define void @g() //CHECK: define void @h() {{.*}} section ".my_code" |