aboutsummaryrefslogtreecommitdiff
path: root/test/Feature/strip_names.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Feature/strip_names.ll')
-rw-r--r--test/Feature/strip_names.ll26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/Feature/strip_names.ll b/test/Feature/strip_names.ll
new file mode 100644
index 000000000000..18c9821544c2
--- /dev/null
+++ b/test/Feature/strip_names.ll
@@ -0,0 +1,26 @@
+; RUN: opt < %s -S | FileCheck %s
+; RUN: opt < %s | opt -S -discard-value-names | FileCheck --check-prefix=NONAME %s
+
+
+; CHECK: @GlobalValueName
+; CHECK: @foo(i32 %in)
+; CHECK: somelabel:
+; CHECK: %GV = load i32, i32* @GlobalValueName
+; CHECK: %add = add i32 %in, %GV
+; CHECK: ret i32 %add
+
+; NONAME: @GlobalValueName
+; NONAME: @foo(i32)
+; NONAME-NOT: somelabel:
+; NONAME: %2 = load i32, i32* @GlobalValueName
+; NONAME: %3 = add i32 %0, %2
+; NONAME: ret i32 %3
+
+@GlobalValueName = global i32 0
+
+define i32 @foo(i32 %in) {
+somelabel:
+ %GV = load i32, i32* @GlobalValueName
+ %add = add i32 %in, %GV
+ ret i32 %add
+}