From 653fe976af88fcf86162ca5bb1b46d4378864572 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 19 Sep 2018 15:27:50 -0400 Subject: Support for IRStringLit (#645) * * Added support for strings in IR with IRStringLit - with storage of chars after it * Added kIRDecorationOp_Transitory - can be used for detecting instructions constructed on stack * Made IRConstant hashing work off type * Fix comment that is out of date about how an instruction is determines to hold a transitory string. --- tests/ir/string-literal.slang | 9 +++++++++ tests/ir/string-literal.slang.expected | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 tests/ir/string-literal.slang create mode 100644 tests/ir/string-literal.slang.expected (limited to 'tests/ir') diff --git a/tests/ir/string-literal.slang b/tests/ir/string-literal.slang new file mode 100644 index 000000000..e0c893014 --- /dev/null +++ b/tests/ir/string-literal.slang @@ -0,0 +1,9 @@ +//TEST(compute):SIMPLE:-dump-ir -profile cs_5_0 -entry main + +[numthreads(1, 1, 1)] +void main( + uint tid : SV_DispatchThreadIndex) +{ + "Hello \t\n\0x083 World"; +} + diff --git a/tests/ir/string-literal.slang.expected b/tests/ir/string-literal.slang.expected new file mode 100644 index 000000000..8df3ff00e --- /dev/null +++ b/tests/ir/string-literal.slang.expected @@ -0,0 +1,20 @@ +result code = 0 +standard error = { +let %1 : _ = UInt() +let %2 : _ = Void() +let %3 : _ = Func(%2, %1) +let %4 : _ = BasicBlock() +Ptr(%1) +let %5 : _ = String() +let %6 : %5 = string_constant("Hello \t\n\0x083 World") + +func @_S04mainp1puV : %3 +{ +block %7( + param %8 : %1): + return_void() +} + +} +standard output = { +} -- cgit v1.2.3