Index: tests_lit/llvm2ice_tests/mangle.ll |
diff --git a/tests_lit/llvm2ice_tests/mangle.ll b/tests_lit/llvm2ice_tests/mangle.ll |
index 399ea2d5d4ece51c07da950cf9f974375fa5f154..d486aada1ef0e1d7380c9575b75bf8e29e72201b 100644 |
--- a/tests_lit/llvm2ice_tests/mangle.ll |
+++ b/tests_lit/llvm2ice_tests/mangle.ll |
@@ -1,11 +1,12 @@ |
; Tests the Subzero "name mangling" when using the "llvm2ice --prefix" |
-; option. |
+; option. Also does a quick smoke test of -ffunction-sections. |
-; RUN: %llvm2ice --verbose none %s | FileCheck %s |
+; RUN: %llvm2ice --verbose none -ffunction-sections %s | FileCheck %s |
; TODO: The following line causes this test to fail. |
; RUIN: %llvm2ice --verbose none %s \ |
; RUIN: | llvm-mc -arch=x86 -x86-asm-syntax=intel -filetype=obj |
-; RUN: %llvm2ice --verbose none --prefix Subzero %s | FileCheck --check-prefix=MANGLE %s |
+; RUN: %llvm2ice --verbose none --prefix Subzero -ffunction-sections %s \ |
+; RUN: | FileCheck --check-prefix=MANGLE %s |
; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s |
; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s |
; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ |
@@ -16,15 +17,19 @@ entry: |
ret void |
} |
; FuncC is a C symbol that isn't recognized as a C++ mangled symbol. |
+; CHECK-LABEL: .text.FuncC |
; CHECK: FuncC: |
-; MANGLE: SubzeroFuncC |
+; MANGLE-LABEL: .text.SubzeroFuncC |
+; MANGLE: SubzeroFuncC: |
define internal void @_ZN13TestNamespace4FuncEi(i32 %i) { |
entry: |
ret void |
} |
; This is Func(int) nested inside namespace TestNamespace. |
+; CHECK-LABEL: .text._ZN13TestNamespace4FuncEi |
; CHECK: _ZN13TestNamespace4FuncEi: |
+; MANGLE-LABEL: .text._ZN7Subzero13TestNamespace4FuncEi |
; MANGLE: _ZN7Subzero13TestNamespace4FuncEi: |
define internal void @_ZN13TestNamespace15NestedNamespace4FuncEi(i32 %i) { |
@@ -32,7 +37,9 @@ entry: |
ret void |
} |
; This is Func(int) nested inside two namespaces. |
+; CHECK-LABEL: .text._ZN13TestNamespace15NestedNamespace4FuncEi |
; CHECK: _ZN13TestNamespace15NestedNamespace4FuncEi: |
+; MANGLE-LABEL: .text._ZN7Subzero13TestNamespace15NestedNamespace4FuncEi |
; MANGLE: _ZN7Subzero13TestNamespace15NestedNamespace4FuncEi: |
define internal void @_Z13FuncCPlusPlusi(i32 %i) { |
@@ -40,7 +47,9 @@ entry: |
ret void |
} |
; This is a non-nested, mangled C++ symbol. |
+; CHECK-LABEL: .text._Z13FuncCPlusPlusi |
; CHECK: _Z13FuncCPlusPlusi: |
+; MANGLE-LABEL: .text._ZN7Subzero13FuncCPlusPlusEi |
; MANGLE: _ZN7Subzero13FuncCPlusPlusEi: |
define internal void @_ZN12_GLOBAL__N_18FuncAnonEi(i32 %i) { |
@@ -48,7 +57,9 @@ entry: |
ret void |
} |
; This is FuncAnon(int) nested inside an anonymous namespace. |
+; CHECK-LABEL: .text._ZN12_GLOBAL__N_18FuncAnonEi |
; CHECK: _ZN12_GLOBAL__N_18FuncAnonEi: |
+; MANGLE-LABEL: .text._ZN7Subzero12_GLOBAL__N_18FuncAnonEi |
; MANGLE: _ZN7Subzero12_GLOBAL__N_18FuncAnonEi: |
; Now for the illegitimate examples. |
@@ -58,6 +69,7 @@ define internal void @_ZN(i32 %i) { |
entry: |
ret void |
} |
+; MANGLE-LABEL: .text.Subzero_ZN |
; MANGLE: Subzero_ZN: |
; Test for _Z<len><str> where <len> is smaller than it should be. |
@@ -65,6 +77,7 @@ define internal void @_Z12FuncCPlusPlusi(i32 %i) { |
entry: |
ret void |
} |
+; MANGLE-LABEL: .text._ZN7Subzero12FuncCPlusPluEsi |
; MANGLE: _ZN7Subzero12FuncCPlusPluEsi: |
; Test for _Z<len><str> where <len> is slightly larger than it should be. |
@@ -72,6 +85,7 @@ define internal void @_Z14FuncCPlusPlusi(i32 %i) { |
entry: |
ret void |
} |
+; MANGLE-LABEL: .text._ZN7Subzero14FuncCPlusPlusiE |
; MANGLE: _ZN7Subzero14FuncCPlusPlusiE: |
; Test for _Z<len><str> where <len> is much larger than it should be. |
@@ -79,6 +93,7 @@ define internal void @_Z114FuncCPlusPlusi(i32 %i) { |
entry: |
ret void |
} |
+; MANGLE-LABEL: .text.Subzero_Z114FuncCPlusPlusi |
; MANGLE: Subzero_Z114FuncCPlusPlusi: |
; Test for _Z<len><str> where we try to overflow the uint32_t holding <len>. |
@@ -86,6 +101,7 @@ define internal void @_Z4294967296FuncCPlusPlusi(i32 %i) { |
entry: |
ret void |
} |
+; MANGLE-LABEL: .text.Subzero_Z4294967296FuncCPlusPlusi |
; MANGLE: Subzero_Z4294967296FuncCPlusPlusi: |
; Test for _Z<len><str> where <len> is 0. |
@@ -93,6 +109,7 @@ define internal void @_Z0FuncCPlusPlusi(i32 %i) { |
entry: |
ret void |
} |
+; MANGLE-LABEL: .text._ZN7Subzero0EFuncCPlusPlusi |
; MANGLE: _ZN7Subzero0EFuncCPlusPlusi: |
; Test for _Z<len><str> where <len> is -1. LLVM explicitly allows the |
@@ -102,6 +119,7 @@ define internal void @_Z-1FuncCPlusPlusi(i32 %i) { |
entry: |
ret void |
} |
+; MANGLE-LABEL: .text.Subzero_Z-1FuncCPlusPlusi |
; MANGLE: Subzero_Z-1FuncCPlusPlusi: |
@@ -115,14 +133,16 @@ entry: |
; (to test parser edge cases) |
define internal void @_Z3fooP10MyClassS1xP10MyClassS2xRS_RS1_S_S1_SZZZ_SZ9ZZ_S12345() { |
-; MANGLE: _ZN7Subzero3fooEP10MyClassS1xP10MyClassS2xRS0_RS2_S0_S2_S1000_SZA00_S12345: |
+; MANGLE-LABEL: .text._ZN7Subzero3fooEP10MyClassS1xP10MyClassS2xRS0_RS2_S0_S2_S1000_SZA00_S12345 |
+; MANGLE: _ZN7Subzero3fooEP10MyClassS1xP10MyClassS2xRS0_RS2_S0_S2_S1000_SZA00_S12345: |
entry: |
ret void |
} |
; Test that unmangled (non-C++) strings don't have substitutions updated. |
define internal void @foo_S_S0_SZ_S() { |
-; MANGLE: Subzerofoo_S_S0_SZ_S: |
+; MANGLE-LABEL: .text.Subzerofoo_S_S0_SZ_S |
+; MANGLE: Subzerofoo_S_S0_SZ_S: |
entry: |
ret void |
} |